From: Sean O'Halpin Date: 2006-07-21T10:22:18+09:00 Subject: Re: recursion in scripts -- global variables required? On 7/20/06, Eric Armstrong wrote: > Recursion is only being used to restart the > timer after it expires. No stack space is > required. Any sufficiently optimizing compiler > will take the stack out of the equation. > (Whether ruby does so is another matter.) It doesn't - you'd quickly run out of stack space. > > The question is really about the nature of > instance variables in a script, I guess. > > It seems they can only be initialized in a > method. Not so. Try this: @foo = 1 def bar p @foo end bar #=> 1 Regards, Sean