From: matz@... (Yukihiro Matsumoto) Date: 2001-06-27T10:11:57+09:00 Subject: [ruby-talk:16944] Re: rb_define_class() vs Class.new() Hi, In message "[ruby-talk:16937] Re: rb_define_class() vs Class.new()" on 01/06/27, Kero van Gelder writes: |> Unnamed class object is referenced from two constants A and B. When |> a.name is called (or whenever class name is required), Ruby looks for |> the class name via internal constant table. Since constant table is a |> hash, it's hard to tell name would be either A or B. | |1) I asked to leave implementation details out of this. I think a hash | is such a detail :) Oops. ;-) |2) A, B = a, a sets a.name() to return B (on my machine?), however | A = a; B = a sets a.name() to return A, so I probably don't | understand which hash you mean anyway. OK. I try again. When a.name is called (or whenever class name is required), where a is a class unnamed yet, and referenced from multiple constants, it chooses arbitrary constant name for its name. Does this make things clear? |The name of a class is _the_ name of that class. |I do not understand what you mean with ``just a name''. Dave answered for you in [ruby-talk:16939]. I can't think of any better answer than that. matz.