Comma quibbling: Difference between revisions

Content added Content deleted
Line 4,231: Line 4,231:
=={{header|Sidef}}==
=={{header|Sidef}}==
<syntaxhighlight lang="ruby">func comma_quibbling(words) {
<syntaxhighlight lang="ruby">func comma_quibbling(words) {
'{' + ([words.ft(0, -2).join(', ')]-[''] + [words.last] -> join(' and ')) + '}';
'{' + ([words.first(-1).join(', ')]-[''] + [words.last] -> join(' and ')) + '}'
}
}


[<>, <ABC>, <ABC DEF>, <ABC DEF G H>].each { |w|
[<>, <ABC>, <ABC DEF>, <ABC DEF G H>].each { |w|
say comma_quibbling(w);
say comma_quibbling(w)
}</syntaxhighlight>
}</syntaxhighlight>
{{out}}
{{out}}