From: David Alan Black Date: 2002-07-25T01:15:23+09:00 Subject: Re: Syntax "surprise" Hi -- On Thu, 25 Jul 2002, Mike Hall wrote: > Kyle Rawlins wrote: > > > > On Wed, Jul 24, 2002 at 12:46:37AM +0900, Mike Hall wrote: > > > obj.method a, b, c {|i| xyz} > > > vs > > > obj.method a b c {|i| xyz} > > > Wouldn't this add a significant amount of ambiguity and confusion? what if a > > is a function that takes two arguments? what if the second is optional? > > Don't we have the same problem now, with commas? > We "solve" it with parens to group the arguments > and to clearly specify who goes with what. I don't think it's the same problem. If you've got: obj.method a, b, c {|i| xyz} and (say) b is a method call that takes one optional argument, there's no danger that c will be interpreted as that argument. I suspect that a Ruby-like language without commas separating method arguments would end up with an awful lot of parentheses instead. (We do have/use them now, as you point out, but they'd also have to do what commas now do.) David -- David Alan Black home: dblack@candle.superlink.net work: blackdav@shu.edu Web: http://pirate.shu.edu/~blackdav