Hi --

On Sun, 20 Mar 2005, Navindra Umanee wrote:

> David A. Black <dblack / wobblini.net> wrote:
>> I'm getting very confused by all of this, especially calling a lambda
>> with ().  (I know it's a popular idea, is done in other languages,
>> etc.  I mean I'm getting confused by how all these things fit into
>> Ruby.)
>
> Why?  It seems natural to call a function with ().

I'm not sure about the naturalness of it -- I'm more thinking about
the fact that () isn't a method, whereas x(), where x is an object
reference (rather than a method identifier), looks like you're calling
the method () on x.

In other words, given this:

    def a; end
    b = lambda {}

a and b are not the same thing or kind of thing, but allowing a() and
b() (rather than a() and b.call) makes them appear the same.  (I know
that they are both callable things, in a sense, but I'm examining it
at a more granular level.)

When I say I am confused by how this fits into Ruby, what I mean is
that it seems like a step toward some kind of method/lambda
unification, but not really a whole unification design.  Matz's
explanation of these as experimental changes makes sense of that
perception.


David

-- 
David A. Black
dblack / wobblini.net