Comma quibbling: Difference between revisions

Content deleted Content added
Not a robot (talk | contribs)
Add APL
Aerobar (talk | contribs)
Line 3,924:
 
=={{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 <code>IFTE</code> 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
{{in}}
<pre>
'CMAQBL' STO
{ } CMAQBL
 
{ "ABC" } CMAQBL
{ "ABC", "DEF" } CMAQBL
{ "ABC", "DEF", "G", "H" } CMAQBL
</pre>
{ "ABC", "DEF", "G", "H" } CMAQBL
{{out}}
<pre>
Line 3,950:
1: "{ABC, DEF, G and H}"
</pre>
 
 
=={{header|Ruby}}==