D
David Garamond
Sorry if the answer is obvious, but I can't find a satisfactory or more
verbose explanation about this. The only thing I found is from the
Ruby's User Guide:
"As with globals, instance variables have the nil value until they are
initialized. Instance variables of ruby do not need declaration. This
implies a flexible structure of objects. In fact, each instance variable
is dynamically appended to an object when it is first referenced."
Could someone explain the above? How is it more flexible? Also, how do
we differentiate between an unitialized global/instance variable and a
variable that has explicitly been set to 'nil'?
verbose explanation about this. The only thing I found is from the
Ruby's User Guide:
"As with globals, instance variables have the nil value until they are
initialized. Instance variables of ruby do not need declaration. This
implies a flexible structure of objects. In fact, each instance variable
is dynamically appended to an object when it is first referenced."
Could someone explain the above? How is it more flexible? Also, how do
we differentiate between an unitialized global/instance variable and a
variable that has explicitly been set to 'nil'?