[squeak-dev] Identifying Objects

Levente Uzonyi leves at elte.hu
Fri Mar 30 09:33:19 UTC 2012


On Thu, 29 Mar 2012, Tim Felgentreff wrote:

> On 03/29/2012 04:12 AM, Robert Carleton wrote:
>> I have an application where I escalate alert instances up through an instance hierarchy. This is probably a FAQ, but I'd like to clearly identify the instances that generate these alerts. Is there some kind of message I can run on an instance, to retrieve an identifier, that can be stored in the alert?
>>
>> TIA,
>>
>> 			--Bruce
>>
>>
>
> Not sure what you mean, if the object id works for you, send #asOop
>
>

It's not a good idea to use #asOop in Squeak, since there is no unique and
immutable identifier of the objects. This method works great (except for 
the case when #become: is being used) for smalltalks which use an object 
table.
As others suggested, using the object itself (optionally wrapped in a 
WeakArray) is the best solution.


Levente


More information about the Squeak-dev mailing list