hmmm.. thnx. ur right. but even accepting that thats just how closures 
are, what about my second version?

> foo = lambda {p b}
> eval "b=1", foo
> foo.call

1) why does b get bound in the global scope??? shouldn't it become local 
to to foo?

2) and in any case, since b=1 is being evaluated in the context of foo's 
binding, and foo is being called later, shouldn't this be equivalent to 
defining b before foo is called (and therefore this shouldn't give an 
error)??

3) if not, what does passing foo to eval actually do, since the 
behaviour seems to be the same whether or not i pass foo (i.e. the 
variable is bound in the global scope, and the closure cannot see it)


-- 
Posted via http://www.ruby-forum.com/.