From: Michael Edgar Date: 2011-06-20T14:02:20+09:00 Subject: Re: CORE - Inconsistent Handling of Uninitialized Variables On Jun 20, 2011, at 12:55 AM, Gary Wright wrote: > Just speculation on my part but if you had implicit-initialization, then the scope of the instance variable would be very dependent on the order in which various classes were parsed. An errant reference to the class variable in a subclass would effectively hide the same class variable in a superclass, which is probably not what is intended. Given my most common use of class variables (shared array/hash/object which is mutated by the inheritance hierarchy), this makes sense. The cvar is written once at the top of the class tree, and read and mutated multiple times by subclasses. Interestingly, @@cvar ||= ... doesn't raise (in 1.9.2 at least) if it has not been initialized. Michael Edgar adgar@carboni.ca http://carboni.ca/