>>>>> "A" == Alan Stern <stern / rowland.org> writes:

A> 	First, the source is rather long and hard to understand.

 Well, if you really think this then you must look at the source of a P
 language :-)

A> Instance variables are nearly as simple.  Every object contains a
A> table of instance variable values, and an instance variable name is
A> looked up in the table of the current object (i.e., the value of
A> "self").

 instance variables are "private" variables

A> You would think that class variables would be equally simple to
A> explain, but they're not. 

 class variables are "shared" variables

A> Local variables operate by way of bindings.

 local variables are resolved at compile time

A> 	[That the order of the lookups works as described can be
A> demonstrated by the following sample code:

 a class is just an object like any other objects.

A> For a qualified constant name, like AClass::CONST or ::CONST, the
A> search starts in AClass or the top-level class (however that gets set;
A> the top-level class is altered during processing of a file by the
A> Kernel#load command if the wrap parameter is set to true).

 Well be carefull with this, even with the wrapper you can retrieve old
 constants like ::Array and modify the class if you want.

A> The overall effect is that constants behave as though they really do
A> have a static scope.

 This is the intented use, I think.



Guy Decoux