From: "David A. Black" Date: 2008-05-06T01:48:33+09:00 Subject: Re: lambda, ->, haskell, and so on Hi -- On Mon, 5 May 2008, Paul Brannan wrote: > On Thu, May 01, 2008 at 12:26:47PM +0900, Dave Thomas wrote: >> This is one of those e-mails that I know from the start to be futile, >> but... >> >> For a while now, the >> >> -> (params) { block } >> >> syntax in Ruby 1.9 has bothered me, but I've never been sure why. >> Today, while playing with pure, it struck me. The '->' sequence is in >> an unexpected place. Having played with some functional languages, I'm >> used to lambdas being written > > I agree. To me the -> looks like an arrow rather than a lambda, so it > reels like it should be between two items. > > What if "lambda" were to become a keyword, so one could write: > > lambda(params) { block } > > as an alternative to the -> syntax? That would definitely be better. You'd then have, I assume: lambda {|x,y,z| block } # block/yield arg. semantics lambda(x,y,z) { block } # method semantics which would, I think, cover what's needed. 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 24-27 London (Skills Matter) See http://www.rubypal.com for details and updates!