From: "ara.t.howard" Date: 2008-05-23T00:34:57+09:00 Subject: Re: Prevent ruby constant variables from changing? On May 22, 2008, at 7:12 AM, Florian Gilcher wrote: > So how does the creation of an anonymous class hurt the argument > that class names are constants? it's not not anonymous, it's held in a variable, just as normal classes are c = Class.new class C; end C = Class.new it's subtle, but there is no such thing as a 'class name', rather there are classes that a held in variables, often these variables are constants, but not always, and it is true that ruby give you the illusion that they are names via a handy Class#name method, but note that this is really just inspect and not specific to classes: cfp:~ > ruby -e 'class C;end; module M;end; p C.name; p C; p M.name; p M' "C" C "M" M the name is not special, just a method: cfp:~ > ruby -e' class C;end; Constant = C; p Constant.name; def Constant.name; "Constant"; end; p Constant.name ' "C" "Constant" regards. a @ http://codeforpeople.com/ -- we can deny everything, except that we have the possibility of being better. simply reflect on that. h.h. the 14th dalai lama