Navindra Umanee <navindra / cs.mcgill.ca> writes:

> Christian Neukirchen <chneukirchen / gmail.com> wrote:
>> > Ruby blocks are just syntactic sugar for a special-case lambda.  Ruby
>> 
>> Care to elaborate?  What's lacking?
>
> Yeah, sorry for being unclear.  I was referring to higher-order
> functions i.e. Ruby blocks allow you to pass one anonymous lambda to a
> higher-order function with convenient syntax...  for more than that it
> gets less convenient.

This apparently got better with the anonymous blocks recently imported
in CVS, but I didn't try that yet.  It's a restriction by design,
though.

>> > doesn't support generic lambda half as cleanly, as say, Scheme.  What
>> 
>> You cannot do lambda{|x|x*2}(2), yes.
>
> Yup, and for calling functions objects in general.

Yes.  And actually this is proper OO.  I couldn't justify mylambda()
somehow.

>> Python's lambda was broken anyway (only one expression allowed) and
>> the "closures" didn't seem to deserve that name from what I recall.
>> Still, in some cases it can't be easily removed (e.g. GUI callbacks)
>> without losing functionality.  But IANAP.
>
> Agreed.  IANAP either.
>
>> I don't care what methods Guido drops and whatnot.  After all, you
>> still can write your own map, filter and reduce.  But when you drop
>> lambdas and any way to closure (from what I have read, inner functions
>> can't access outer variables), it's more than a dumb move IMO.
>
> Again, I don't have that detailed knowledge about Python, but Guido says:
>
> "also, there is a widespread misunderstanding that lambda can do
> things that a nested function can't -- I still recall Laura
> Creighton's Aha!-erlebnis after I showed her there was no difference!"

Interesting... stuff must have been totally broken then. ;-)

> So, I presume he has his bases covered.

Fixing lambdas wouldn't have been an option, of course. :P

> Cheers,
> Navin.
-- 
Christian Neukirchen  <chneukirchen / gmail.com>  http://chneukirchen.org