From: David Douthitt Date: 2002-07-17T23:48:54+09:00 Subject: Syntax "surprise" This is a MIME message. If you are reading this text, you may want to consider changing to a mail reader or gateway that understands how to properly handle MIME multipart messages. ----=_NextPart_ST_09_40_42_Wednesday_July_17_2002_11763 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable I don't know if this qualifies as a real "surprise", but it was to me. I h= ad thought this syntax would work: opts =3D GetoptLong.new( [ "--verbose", "-v", GetoptLong::NO_ARGUMENT ], [ "--yesterday", "-y", GetoptLong::NO_ARGUMENT ], ) Now that fails.... but the following works: opts =3D GetoptLong.new( [ "--verbose", "-v", GetoptLong::NO_ARGUMENT ], [ "--yesterday", "-y", GetoptLong::NO_ARGUMENT ] ) It's the one solitary COMMA at the end that did it. I remember reading in = my Perl books that they allow the oddity of an extra comma at the end so on= e can cut and paste over and over and not have to strip that extra annoying= comma. I thought Ruby did that, but not here... Why not? David Douthitt CUNA & Affiliates UNIX Systems Administrator ddouthitt@cuna.coop ----=_NextPart_ST_09_40_42_Wednesday_July_17_2002_11763 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
I don't know if this qualifies as a real "surprise", bu= t it=20 was to me.  I had thought this syntax would work:
 
opts =3D GetoptLong.new(
    [ "--verbose", "-v", =20 GetoptLong::NO_ARGUMENT ],
    [ "--yesterday", "-y",=20 GetoptLong::NO_ARGUMENT ],
)
 
Now that fails.... but the following works:
 
opts =3D GetoptLong.new(
    [ "--verbose", "-v", =20 GetoptLong::NO_ARGUMENT ],
    [ "--yesterday", "-y",=20 GetoptLong::NO_ARGUMENT ]
)
 
It's the one solitary COMMA at the end that did it.&nbs= p; I=20 remember reading in my Perl books that they allow the oddity of an extra co= mma=20 at the end so one can cut and paste over and over and not have to strip tha= t=20 extra annoying comma.  I thought Ruby did that, but not=20 here...
 
Why not?
 
 
David Douthitt
CUNA & Affiliates
UNIX Systems= =20 Administrator
ddouthitt@cuna.coop
 
 
----=_NextPart_ST_09_40_42_Wednesday_July_17_2002_11763--