From: Brian Candler Date: 2003-05-31T00:39:48+09:00 Subject: Re: local variable and local variable in block behave differently On Sat, May 31, 2003 at 12:32:28AM +0900, ahoward wrote: > On Sat, 31 May 2003, ts wrote: > > > Well, it's more > > > i was *trying* to say that... ;-) > > one thing i'm fuzy on though - ruby parses/runs in one pass I don't think so - it parses and builds an AST in a single pass, then it walks the AST after that. Certain types of syntax error break at the parsing stage, so nothing gets run. But note that the *parsing* of a class or method definition does not actually create the class or method; it is only when it is run that the class is created. At an extreme: print "Do you want debugging? " if gets =~ /\A[Yy]/ class Foo .. debug version end else class Foo .. non-debug version end end The class definitely isn't defined until run-time. Regards, Brian.