From: Robert Klemme Date: 2008-03-24T06:35:02+09:00 Subject: Re: Sytem hook for instance names? On 23.03.2008 19:30, Mark Bush wrote: > Jeff Patterson wrote: >> Is there a system hook that allows a method to get an instance's symbol >> from its' object id? >> >> i.e. >> >> a=SomeObject.new >> SomeSystemhook(a) => :a (or "a" I suppose) > > The problem is that the variable is not the object, just a pointer to > it. And there can be multiple variables pointing to the object. So: > > a = SomeObject.new > b = a > > Now "a" and "b" both point to the same object. How would you choose > between returning :a and :b? Plus, what would you do in this case? a=[SomeClass.new] Basically it makes no sense... Cheers robert