From: Jeremy McAnally Date: 2008-05-09T00:46:22+09:00 Subject: Re: lambda, ->, haskell, and so on Not only that but don't you think that it's going to cause conflicts with current Hash assignment semantics? --Jeremy On Thu, May 8, 2008 at 11:35 AM, David A. Black wrote: > Hi -- > > > > On Thu, 8 May 2008, Michael Neumann wrote: > > > > ara howard wrote: > > > > > > > > On Apr 30, 2008, at 9:26 PM, 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 > > > > > > > > \ params -> block > > > > > > > > > > i like the '->' because it suggests very nice multi-block syntax > > > > > > filter( > > > > > > :before -> { buf.upcase }, > > > > > > :after -> { bug.downcase } > > > > > > ) > > > > > > > Note that this already works in ruby19: > > > > filter before: -> { buf.upcase }, after: -> { buf.downcase} > > > > The arrow really looks weird there, since it's not pointing to > anything but looks all the more like it is (since there's something on > the left). I can imagine people will wonder why: > > one: -> "string" > > doesn't mean that "string" goes with one:.... I don't mind people > having to learn stuff, but this just seems like asking for trouble. > > > > > 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! > > -- http://jeremymcanally.com/ http://entp.com Read my books: Ruby in Practice (http://manning.com/mcanally/) My free Ruby e-book (http://humblelittlerubybook.com/) Or, my blogs: http://mrneighborly.com http://rubyinpractice.com