-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
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
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
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
-----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
On 29.03.2012, at 04:12, 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
Why not keep a reference to the instance itself?
- Bert -
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On Mar 29, 2012, at 7:59 AM, Bert Freudenberg wrote:
On 29.03.2012, at 04:12, 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
Why not keep a reference to the instance itself?
- Bert -
Coincidentally, I was just testing that.
Thanks,
--Bruce
squeak-dev@lists.squeakfoundation.org