Comma quibbling: Difference between revisions

(→‎{{header|Vlang}}: Rename "Vlang" in "V (Vlang)")
Line 3,910:
{ABC, DEF, G and H}
</pre>
 
=={{header|RPL}}==
Whilst it is always important to ensure overall code clarity for maintenance by using explicit variable names and structured control flows, the spirit of reverse Polish notation programming is to optimize some key part of the algorithm in order to make it as compact - and possibly as fast - as possible, whatever the induced loss of readability. Here, two IFTE low-level instructions are nested to deliver the appropriate liaison substring between two words or before the first word.
{{works with|Halcyon Calc|4.2.7}}
≪ DUP SIZE → words n
≪ "{" 1
WHILE DUP n ≤ REPEAT
DUP 1 ≠ OVER n ≠ ", " " and " IFTE "" IFTE
ROT SWAP +
words 3 PICK GET +
SWAP 1 +
END
DROP "}" +
'CMAQBL' STO
 
{ } CMAQBL
{ "ABC" } CMAQBL
{ "ABC", "DEF" } CMAQBL
{ "ABC", "DEF", "G", "H" } CMAQBL
{{out}}
<pre>
4: "{}"
3: "{ABC}"
2: "{ABC and DEF}"
1: "{ABC, DEF, G and H}"
</pre>
 
 
=={{header|Ruby}}==
1,150

edits