Benny wrote:
> 
> so if I get you right, when creating a new class three things happens:
> 1. creation of a new class-object
> 2. setting the attribute "name" of the class to the given class name
> 3. creation of a constance with the given class name as reference to the new
> class-object
> 
> tant mieux!
> 
> then we could do the same thing everytime an object is created ( = set with
> "=")!

We *could* in theory do that.

But you already see that it does not work 100% with class names.
And nothing in Ruby actually *relies* on this working.

What if we have an array of 100 objects? Each has no other name
than foo[73] or whatever. Do we really want to store the string
"foo[73]" somewhere? What if we do a delete, or a sort? Now these
have changed. Do we really want to update all these in realtime?

What about Hashes?

What about Structs and class members that have no other names
except complex names like Foo::Bar::myclass.mymember ?

My opinion is: You would be better off abandoning this idea, or if
you really, really need this functionality, implement something
of your own in Ruby.


Hal