From: Daniel Schierbeck Date: 2005-11-01T06:37:06+09:00 Subject: Re: Anonymous methods, blocks etc. (Cont. 'default block params') Zach Dennis wrote: > Zach Dennis wrote: > >> Trans wrote: >> >>> Zach Dennis wrote: >>> >>>>> I just >>>>> don't particularly care for the proposed syntax: >>>>> >>>>> anon = ->(x = 5) { ... } >>>>> >>>> >>>> Was there an RCR for this syntax? If so what is it's name, I do not see >>>> it on rcrchive.net ? >>> >>> >>> >>> >>> It's Matz' baby; borrwoed from Perl. So no RCR required. >>> >> >> Is the -> syntax still open for debate Matz? I agree with Austin on >> this. The syntax here is just ugly. > > > I wanted to partially rephrase this last comment in case it comes across > the wrong way. Is the syntax open for debate at all? If not then I > respectfully withdraw any further arguments on my behalf on this topic. > If it is open for debate, then I'd like to voice my opinion as others > have already, that I would rather prefer a more elegant syntax. > > Thanks, > > Zach > > I agree. The `->(args) {}' syntax is cluttered and hard to read. The best solution would be to make the parser work with default values for block arguments. I know that will take some work, but it's by far the most elegant and consistent solution. lambda { |a, b = nil| ... } Cheers, Daniel