From: Benoit Daloze Date: 2010-04-02T01:22:05+09:00 Subject: Re: Post-Condition if Statements And NameErrors --00163646b96453b39d04832f43ad Content-Type: text/plain; charset=ISO-8859-1 > Something like this came up a few weeks ago. I think the parser is the > one generating the NameError, because the parser only consider a > variable to be defined if it sees an assignment to it, and such > assignment has to come *before* any use of the variable. Even though > the interpreter actually would actually execute y = bs first, the > parser doesn't see it at the point where its value is used. > Yeah, that's a bit annoying and considerably reduce while-one-liners possibilities: lines = IO.read('mac.txt').lines.to_a puts line while line = lines.pop but that works if you assign anything to line before ... --00163646b96453b39d04832f43ad--