From: gabriele renzi Date: 2004-05-03T19:59:00+09:00 Subject: Re: Lazy evaluation (evil) il Mon, 03 May 2004 12:30:53 +0200, Kristof Bastiaensen ha scritto:: > >I agree on everything except point (2). Just because there are >also methods, which are different things as procs, doesn't mean >that there are no first class functions. Take the following code: >add = lambda { |x| lambda { |y| y + x }} >add2 = add.call(2) >add2.call(5) >=> 7 >add2.call(7) >=> 9 a little cosmethic change: >> add = lambda { |x| lambda { |y| y + x }} => # >> add7= add[7] => # >> add7[5] => 12 >> you can use var[args] with callable objects (continuations, methods, procs) >This works just like it does in scheme. I'm not an expert, but ruby models should be closer to LISP than scheme, cause function/methods are not in the same 'namespace', wich is true in scheme. I mean, we have method() and LISP has the sharp-quote notation. But I may be cmpletely wrong.