From: ts Date: 2004-04-21T22:03:37+09:00 Subject: Re: Ruby proposal: MAIN_BINDING >>>>> "D" == Dan Doel writes: D> The issue (as I understand it), is that #eval opens up a new scope Well, not really. The problem is this is at *compile* time that ruby make the difference between a variable and a method When you write eval("a = 'hello'",MAIN_BINDING) puts a ruby at compile time see a string and the statement puts a which is interpreted as puts a() # method call because no local variable with the name `a' # was defined and you can't change this, just imagine def tt(str) eval(str) puts a end tt("a = 'hello'") tt("b = 'hello'") ruby will not be able to see, that *latter* the method #tt will be called with "a = 'hello'", and in this case `a' can be a local variable. Just imagine that ruby read line from a file and then call the method #tt with these lines. Worst and perhaps I've forgotten to say it : eval is evil Guy Decoux