From: "David A. Black" Date: 2005-04-06T23:23:24+09:00 Subject: Re: Garden RubyNuby Question on parameters in blocks vs. methods Hi -- On Wed, 6 Apr 2005, Douglas Livingstone wrote: > On Apr 6, 2005 4:11 AM, Daniel Amelang wrote: >>> As for the first. Why not "do (a,b) ... end" instead of "do |a,b| ... >>> end" Well, without thinking about it to much, I imagine it is simply >>> due to syntax ambiguities. >> >> I've wondered about this one before. It would be _possible_ to change >> the method definition to use pipes instead of parans, and not have >> ambiguities (I think), but that's a pretty significant language >> change. I guess they were just born that way, and it's too late to >> change. > > So these two would be the same, right? > > def myfunc(foo = nil, bar = nil) > end > > def myfunc |foo, bar| > end Hopefully it would be one or the other (the second only if there were some huge unification going on where parens were eliminated for method definitions). David -- David A. Black dblack@wobblini.net