From: avi@...4.com (Avi Bryant) Date: 2002-05-18T19:26:27+09:00 Subject: Re: function that returns function spam@bugbear.com (Paul Graham) wrote in message news:<4f52f844.0205170850.625036b9@posting.google.com>... > I'm writing something showing how you'd write the same > simple program in various different languages. I'd > appreciate it if some Ruby expert could tell me the > canonical way to write in Ruby what you would express > in Scheme as > > (define (foo x) (lambda (y) (set! x (+ x y)))) How about: def foo(x) lambda{|y| x = x+y} end