From: Mark Bush Date: 2008-03-24T07:32:45+09:00 Subject: Re: Sytem hook for instance names? Robert Klemme wrote: > Plus, what would you do in this case? > > a=[SomeClass.new] Actually, in this case it's not so bad. The variable "a" refers to the array (so you're not interested in the array contents) so you can use similar methods on local variables to get it's name, then do: eval var on each local variable to see if the object returned is your original one, just not easily in a method as local variables are now in a different scope, albeit the scope of the caller (and being very, very careful about exceptions and side effects). What really made me cringe was: a = nil Now what? That's when I went and opened a bottle of wine and watched a movie. I agree 100% though that the real issue here is that Jeff wants the name of an object to be an attribute and the best way to do that is to, well, make the name an attribute. -- Posted via http://www.ruby-forum.com/.