From: "David A. Black" Date: 2008-05-27T18:49:24+09:00 Subject: Re: [PATCH] lambda with normal block syntax Hi -- On Tue, 27 May 2008, Yukihiro Matsumoto wrote: > Hi, > > In message "Re: [PATCH] lambda with normal block syntax" > on Mon, 26 May 2008 23:14:56 +0900, Dave Thomas writes: > > |You asked people to try the patched syntax that allows > | > | meth {|a| a+1}, {|b| b*2} > | > |I think that this particular syntax is a lot less obtrusive, and a lot > |easier to recognize, than > | > | meth -> a { a + 1}, -> b { b * 2 } > | > |The first one is obviously a couple of blocks: that's what I read when > |I see {|a| ...}. > | > |It seems that most of the posters on this thread agree. And, using > |your criteria of "try it for a while and see", I'd judge that people > |have tried -> for a while, and might well be happier with the {|| } > |version. > > Personally I don't like > > meth {|a| a+1}, {|b| b*2} > > which can be parsed > > (meth() {|a| a+1}), ({|b| b*2}) > > or > > meth({|a| a+1}, {|b| b*2}) > > or whatever. I dislike this kind of ambiguity. In fact, you would > expect the latter, but I'm afraid Eric's patch gives you the former. > This could be a very evidence of (bad) ambiguity. That's why I asked > people to try the patch. Maybe the same rule could be applied to {||...} lambda objects (as opposed to the code block) that is now applied to hashes: meth {} # code block meth({}) # one hash argument meth {||} # code block meth({||}) # one lambda object argument David -- Rails training from David A. Black and Ruby Power and Light: INTRO TO RAILS June 9-12 Berlin ADVANCING WITH RAILS June 16-19 Berlin INTRO TO RAILS June 23-26 London (Skills Matter) See http://www.rubypal.com for details and updates!