On Apr 6, 2007, at 2:24 PM, Rick DeNatale wrote:
>>    2) when they are referenced in an expression, in which case  
>> they are
>>       initialized with a reference to the nil object.
>
> No, they are not initialized (or even defined) at this point.  They
> just evaluate syntactically to nil.  See line 6 above.

Thanks for the correction.  I could have sworn that I tested that code
before posting to make sure I understood what was going on.  Maybe I
had some left over variables from earlier in the irb session.

So it is *only* assignment and instance_variable_set that will cause
an instance variable to become defined and bound to a reference.

Undefined instance variables evaluate to nil.


Gary Wright