From: Brad Cox Date: 2002-07-18T01:39:38+09:00 Subject: Re: Syntax "surprise" Still, its a shame ruby adopts the same shortcoming as java. Its not a language's business to prevent users from writing "smelly" code. Long argument lists are common in data initialization contexts, and misplaced commas a extremely common problem, that's actively manufactured by this rule. @@instance = SomeClass.new( "127.0.0.1", 8083, "hostname.com", blah, blah, whoops, ); At 12:44 AM +0900 7/18/02, Yukihiro Matsumoto wrote: >Hi, > >In message "Re: Syntax "surprise"" > on 02/07/18, Kent Dahl writes: > >|Ugly workaround using array expansion: >| opts = GetoptLong.new(*[ >| [ "--verbose", "-v", GetoptLong::NO_ARGUMENT ], >| [ "--yesterday", "-y", GetoptLong::NO_ARGUMENT ], >| ]) > >Wow, I was just writing the same workaround. You're a mind reader. > >|But I'd have to argue against allowing trailing commas in method calls >|(and definitions), on the basis that it could make it easier to write >|methods that take a lot of parameters. IIRC, a large number of >|parameters to a method is a "code smell", and allowing the trailing >|comma would be like spraying some fresh pine scent on it to cover it... > >Wow, in fact, it used to accept trailing comma in argument list, but I >removed that syntax rule for the reason you described here. > > matz. -- Brad Cox, PhD; bcox@virtualschool.edu 703 361 4751 o For industrial age goods there were checks and credit cards. For everything else there is http://virtualschool.edu/mybank o Interactive Learning Environment http://virtualschool.edu/ile o Java Web Application Architecture: http://virtualschool.edu/jwaa