From: Christian Neukirchen Date: 2006-06-23T23:27:38+09:00 Subject: Re: Class#name= Yukihiro Matsumoto writes: > |Well this kind of shocks me, is there an idea behind this which I am > |missing? > > The module referenced from A and B are the same object (mod). If same > module reports different name depends on how it is called, I would > surprise VERY MUCH. For your note, Ruby does not promise that you > don't surprise. It's just impossible. It tries its best to do > reasonable job as much as it can. That's in generally a good idea, but it should be noted that: irb(main):001:0> A = Class.new irb(main):002:0> B = A irb(main):003:0> A.name => "A" irb(main):004:0> B.name => "A" irb(main):005:0> A = nil irb(main):006:0> B.name => "A" irb(main):007:0> A.name NoMethodError: undefined method `name' for nil:NilClass from (irb):7 from :0 Probably not worth trying to fix that "bug". > matz. -- Christian Neukirchen http://chneukirchen.org