On Thu, Mar 27, 2003 at 04:40:40AM +0900, Mauricio FernŠŌdez wrote:
> Do you know if any optimization is done on access to outer scope
> locals? That looks nice but apparently slow (construction of a dict,
> copying table of locals...)

I don't know for sure, but I suspect that it's not much slower than
Ruby.  Ruby does quite a lot behind the scenes when a Proc is
constructed.

I don't think the table of locals is copied; only the reference to the
table of locals should be copied.

> how do I call a Method object the same way as a lambda? 

l = lambda { |x| x + 42}

def foo(x); return x + 42; end
m = Object.method(:foo)

p l.call(42) #=> 84
p m.call(42) #=> 84

Paul