From: Albert Schlef Date: 2009-02-08T13:46:34+09:00 Subject: Re: eval statement Mike Gold wrote: > The thing to remember is that local variables are always determined at > parse time. Yeah. That's why debuggers list local varibales even before we arrive at the assignment to them. > The contents of 'a=2' is not seen by the parser when the file is read, > so in the second case the 'a' in 'puts a' is determined to be a method > call: "call method 'a', then call method puts". I don't think you are correct here. The string 'a=2' is first *parsed*, only then evaluated. If your theory was correct, eval('whatever=567') would have generated some error (because there's no 'whatever=' method). -- Posted via http://www.ruby-forum.com/.