I think the problem with an instance knowing his own name is the possibility of an instance having more than one name. How whould the instance now, which name you want ? The object id on the other hand is afaik sort of unique.
Marinho
I think the problem with an instance knowing his own name is the possibility of an instance having more than one name. How whould the instance now, which name you want ? The object id on the other hand is afaik sort of unique.
Marinho
Yep.
For those old enough, and American enough to remember the comic Bill Saluga.
# You can call Nephew.new...
Ray = Jay = Johnny = Sonny = RayJay = RJ = Nephew.new
# but ya doesn't hafta call it Johnson
On 9/4/06, marinho.tobolla@syncity.de <marinho.tobolla@syncity.de> wrote:
I think the problem with an instance knowing his own name is the possibility of an instance having more than one name. How whould the instance now, which name you want ? The object id on the other hand is afaik sort of unique.
--
Rick DeNatale
My blog on Ruby
http://talklikeaduck.denhaven2.com/