Ah, I think I understand now.

The interpreter see's the class definition and enters scope.  The local
variable is created within that scope.  When the class 'end' is read, the
scope finishes and the variable (providing it's not referenced elsewhere by
then?) becomes a candidate for gc.

Effectively, the variable can only be seen within the scope of the class
definition.

That's not so unusual after all.  Thanks for clearing that up.

Justin Johnson.

"Yukihiro Matsumoto" <matz / ruby-lang.org> wrote in message
news:1026773406.615470.14300.nullmailer / picachu.netlab.jp...
> Hi,
>
> In message "Re: Execution question"
>     on 02/07/16, "Hal E. Fulton" <hal9000 / hypermetrics.com> writes:
>
> |The only question is: Local to what? From its behavior,
> |it exists only within the scope of the class definition.
> |From my quick experiments, as I expected, it can't be
> |referenced from within an instance method of Test, nor
> |obviously from outside the class.
>
> It's local to the scope formed by class body.  Scopes do not nest
> except ones by blocks.  So it's just a plain local variable.
>
> matz.
>