From: Yukihiro Matsumoto Date: 2006-06-23T20:30:54+09:00 Subject: Re: Class#name= In message "Re: Class#name=" on Fri, 23 Jun 2006 20:06:31 +0900, "Robert Dober" writes: |We have an object x, ok we create it now :) | x= mod.new |oh it has a name method, let us see | x.name => "" |great, that is a good name. |BTW I need a constant reference to that object | A = x |A.name will be "" of course I just assigned another reference to the object, |I am a clever guy, I know that pointing another reference to an object can |not possibly change the |behavior (please let us be precise here, behavior not sate, state is |internal, behavior is |what counts to the programmer) | A.name == x.name => true |As I told you, I am sooo great | A.name => "A" |What??? You must be kidding no way. Ruby looks for the name through class hierarchy, when it's asked a name for the class/module that has not been named yet. matz.