This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.

--1926193751-1993632714-12246863504699
Content-Type: TEXT/PLAIN; charset=X-UNKNOWN; format=flowed
Content-Transfer-Encoding: QUOTED-PRINTABLE

Hi --

On Wed, 22 Oct 2008, Trans wrote:

>
>
> On Oct 21, 10:31 pm, Dave Thomas <d... / pragprog.com> wrote:
>> On Oct 21, 2008, at 8:39 PM, Trans wrote:
>>
>>> It something that will take getting used to, but I think matz has
>>> gotten this right actually.
>>
>> Then deprecate lambda. Because having two totally disjoint ways of
>> doing the same thing makes the language diffuse, and can only be a
>> source of confusion. This is a lot worse than having aliased methods,
>> where the syntax is the same and the names are different. The two
>> syntaxes here are totally alien. Choose one, and lose the other, I say.
>
> I see what you're saying, and it's a good point. But I think perhaps
> the two serve different purposes, sort of along the same lines that
> { }'s are usually used for one-liner blocks and do..end for multiple
> lines.
>
> We don't see a lot of this in Ruby:
>
>  foo(lambda{|x| x.upcase })
>
> On the whole, it's too verbose. But I think we would see a little more
> of it if we could do:

You can do &:upcase for most such situations.

>  foo(->x{x.upcase})
>
> I know, it's not the most beautiful syntax in the world. I think that
> mainly b/c the '->' looks like an arrow. If we could use the actual ,
> I don't think there would be nearly as much protest.
>
>  foo(x{x.upcase})

My view is that, now that the problem that ->(){} was a workaround for
has been solved without ->(){}, (thanks Eric M.!), we don't need
->(){}. I'd like to backtrack to the point where the issue was how to
give blocks method-argument semantics, and take the path where it just
gets solved without a lot of line noise. (Yes, I've been studying
Prolog :-) It's not about counting characters. lambda statements are
already quite concise and expressive.


David

-- 
Rails training from David A. Black and Ruby Power and Light:
   Intro to Ruby on Rails  January 12-15   Fort Lauderdale, FL
   Advancing with Rails    January 19-22   Fort Lauderdale, FL *
   * Co-taught with Patrick Ewing!
See http://www.rubypal.com for details and updates!
--1926193751-1993632714-12246863504699--