[squeak-dev] Identifying Objects

Robert Carleton rbc at rbcarleton.com
Fri Mar 30 10:13:14 UTC 2012


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Mar 30, 2012, at 5:33 AM, Levente Uzonyi wrote:

> 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

Levente,

Thanks for your comments. I went with using a reference to the instance. That works for my application.

Best,

			--Bruce

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (Darwin)

iQEcBAEBAgAGBQJPdYc6AAoJEPy/5L3ndSQsvXsIAI3lE4jX/mwMP+O+yecD4e7F
TZAYZsojg41Actdw7dk02WUPTD9KoKFXWjnL062Oyou/F3nSnVQBcVjaKMwQ+aKq
cSZb88RQJlLD/PVVouKRJaAbpWXYowAQIlr6zqA/+n9D4r1/7JfqpcGysv5GAEwg
cXO3uFaEjWiP3zqn/CeZv6Imzy2hqrQKvzLUh3tUecVqQkb6QRehldCcge8JmrbS
eg91Gq7Sir0yGzpuoLUqhiwj8EMxSwWBsMdmH/7vzqXTWNtoHvAtScNw7e8+jJlQ
nGakxA4F3Inywu/K7FCHYNO9KODx0etld71qoYf3PXUUjYSlLAbCSXGrKleABHc=
=sMCs
-----END PGP SIGNATURE-----


More information about the Squeak-dev mailing list