From: Peter Hickman Date: 2002-05-03T20:36:40+09:00 Subject: Re: IDs of the reference ts wrote: >>>>>>"P" == Peter Hickman writes: >>>>>> > >P> I realise that a and b both refer to the same object and thus have the >P> same id, this is not a problem. What I would like is the id of the >P> reference so that I can tell that ref a although pointing to the same >P> object as ref b is not infact the same ref. > > If I've well understood what you call the id of the reference is just the > name of variable :-))) > > In your example, you have 2 variables `a' and `b' which make reference to > the same object `Fred.new' > > What do you want to do with this ? > > >Guy Decoux > > I was hoping that from inside a class, in a method, I could work out which reference was trying to call the method. The variable name is not necessarily unique but somewhere within Ruby the a and b references must be held even if they point to the same object. I'm work out a solution to the const correctness problem currently on RubyGarden. Peter Hickman (aka peterhi)