From: "David A. Black" Date: 2008-05-09T00:49:21+09:00 Subject: Re: lambda, ->, haskell, and so on Hi -- On Fri, 9 May 2008, ara.t.howard wrote: > > On May 8, 2008, at 5:18 AM, David A. Black wrote: >> In other words, not every case will have an arrow built into it, and I >> don't think it's worth the line noise and possibly odd semantics of >> the arrow, in other contexts, just so one class of argument can look >> like it's being pointed to in argument lists. > > well, as michael pointed out, it's already there an i that ruby has shown > itself to be moving more and more into the functional realm so i can only > assume people will leverage this just like other, technically not important, > features like hash collection for the last arg of a function. it really is > small things like this that make ruby so pretty. for the other cases there > is always lambda, which looks fine and only a little heavy. basically i get > dave's point but feel that the functional languages should take a page from > ruby not the other way around - ruby's syntax is easily among the prettiest > on any existing multi-purpose language. The arg: -> {} thing isn't, per se, something you'd leverage, though. arg: value is a general technique, but the presence of the arrow in the case of lambda arguments is just serendipitous. I agree about Ruby's prettiness, of course, but I think there's a delicate balance there too. The problems with arg: -> {} would not make me anti-lambda-arrow if I weren't already, but it's certainly not something I'd miss. In fact, as I mentioned before, I believe it has the potential to be confusing. Anyway, I doubt the ->(){} literal will stand or fall based on what it looks like in an argument list. It's really the arrow-ness of it overall that I think is problematic. 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!