From: William Djaja Tjokroaminata Date: 2002-10-11T23:56:56+09:00 Subject: Different Behavior of Class Variables w.r.t ||= Hi, This is very interesting. Should Ruby be more consistent in this respect? Regards, Bill ========================================================================= dblack@candle.superlink.net wrote: > On Fri, 11 Oct 2002, William Djaja Tjokroaminata wrote: >> It seems that the ||= operator works for local, instance, and class >> variables. > Yes, if the class var is already initialized. However (1.6.7): > candle:~$ ruby -ve 'a ||= 3; @a ||= 3; @@a ||= 3' > ruby 1.6.7 (2002-03-01) [i686-linux] > -e:1: uninitialized class variable @@a in Object (NameError)