so, assuming we have;
print 'you gave me: @wordlist = '; # single quote - no interpolation
for @words -> $it {
print;
FIRST { print '(' } # provisionally
NEXT { print ',' }
LAST {print ');' }
}
# and maybe
else {
print "();\n";
}
this yields:
you gave me: @wordlist = ();
or if (@wordlist) {
# (damn - i want to say orif ;-)
you gave me: @wordlist = (alpha,beta,gamma,);
whereas
print 'you gave me: @wordlist = (', join(',', @words), ")\n";
doesnt include the last comma.
if I remember the thread (now deleted, so cant be accurate)
the last comma would be in there, unlike if it were in a join.
cuz NEXT is a block terminator, not a block-inbetweener
this is vaguely unfortunate, as its not so simple to write
loops to generate SQL ( which isnt as friendly wrt to extra commas as
perl is )
separately ( to re-iterate earlier good thoughts ):
loop {} else {}
would be more visually distinct (easier to read) as
loop {} otherwize {}
esp when loop block is bigger than a screenful, new keyword keeps us
from looking for the if,
and it fits better with natural language (or at least dictionary language )
where the connotation is a final alternative to lots of choices.
http://webster.com/cgi-bin/dictionary?va=otherwise
Main Entry: *^1 oth�er�wise*
<javascript:popWin('/cgi-bin/audio.pl?otherw04.wav=otherwise')>
Pronunciation: -"wIz
Function: /pronoun/
Etymology: Middle English, from Old English (/on/) /Othre wIsan / in
another manner
Date: before 12th century
*:* something or anything else *:* something to the contrary <do very
little to enforce competition--and have never intended /otherwise/ --
Milton Viorst>
vs
Main Entry: *^1 if* <javascript:popWin('/cgi-bin/audio.pl?if000001.wav=if')>
Pronunciation: 'if, &f
Function: /conjunction/
Etymology: Middle English, from Old English /gif; /akin to Old High
German /ibu /if
Date: before 12th century
*1 a* *:* in the event that *b* *:* allowing that * c* *:* on the
assumption that *d* *:* on condition that
*2* *: WHETHER
<http://webster.com/cgi-bin/dictionary?book=Dictionary&va=whether>*
<asked /if/ the mail had come> <I doubt /if/ I'll pass the course>
*3* -- used as a function word to introduce an exclamation expressing a
wish </if/ it would only rain>
*4* *:* even though <an interesting /if/ untenable argument>
- *if anything* *:* on the contrary even *:* perhaps even </if anything,
/you ought to apologize>
look ma, no typing..