Christian Neukirchen <chneukirchen / gmail.com> wrote:
> > 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

I'm not sure how that could be improved, since it's already doing what
it was designed to do.

> in CVS, but I didn't try that yet.  It's a restriction by design,
> though.

Sure, that's why I called it syntactic sugar.  It takes what Matz
thought would or should be a common case use of lambda/higher-order
functions in Ruby and makes it convenient.

I presume Guido is doing the same thing in his own way.  He's making
it convenient to do things people might otherwise do with lambda.  Of
course, he's going the other way and shunning lambda altogether...  so
he's not looking for Lisp/Scheme fans but apparently catering to
another demographic.  Afterall, there are plenty of successful
languages without lambda.

> >> 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.

Proper OO?  Um, well how can you justify:

a = [1, 2]
a[1]

but not:

a = lambda{|x|x*2}
a(1)

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

;-)

Cheers,
Navin.