From: "trans. (T. Onoma)" Date: 2004-10-05T03:51:20+09:00 Subject: Re: Kernel#eval taking a block On Monday 04 October 2004 02:31 pm, David A. Black wrote: > > eval "cool = a.call(cool)", tb > > > > NameError: undefined local variable or method `a' for # > @x=1> from (irb):15:in `get_binding' > > from (irb):15:in `get_binding' > > from (irb):19 > > But if you're eval'ing in another binding, 'a' won't mean anything in > a string or a block, will it? In other words: you're trying to mix > locals from two bindings in one expression, which somewhat defeats the > purpose of having "locals" :-) I see. So this kind of thing just can't happen I take it. (Hmm... I think we discussed this kind of thing on core once.) It would be nice if we could pass in locals to the binding: eval(tb, a) { |a| cool = a.call(cool) } It might also be nice if this could be done without "stepping on toes" (i.e. overwriting binding's locals). T.