William James schrieb: > zslevi wrote: > >> foo = lambda {|x| >> return lambda {|y| return x+y}} >> >> puts (foo.call(3)).call(4) >> >> It works finally, but it's just too verbose. >> Can anyone suggest a shorter, programmer friendlier way of writing >> this? > > Can you see that "proc" is shorter than "lambda"? > > foo = proc{|x| proc{|y| x+y}} > ==>#<Proc:0x02824eb4@(irb):20> > foo[3][4] > ==>7 Javascript: 3+4 Andr--