[Pharo-project] announcements and weak references
Hi, Are there any plans to get Announcements use weak references? I saw that in the repository of Lukas, there is a WeakAnnouncer. However, here the subscriptions are still held in a regular Dictionary. Actually, I am not sure what is the status of weak references. I tried the following, but it does not seem to work: | x array | x := GLMPane new. array := WeakArray with: x. x := nil. Smalltalk garbageCollect. array size ==> 1 Cheers, Doru -- www.tudorgirba.com "We cannot reach the flow of things unless we let go."
On Friday, 7 January 2011, Tudor Girba <tudor.girba@gmail.com> wrote:
Hi,
Are there any plans to get Announcements use weak references?
I saw that in the repository of Lukas, there is a WeakAnnouncer. However, here the subscriptions are still held in a regular Dictionary.
Actually, I am not sure what is the status of weak references. I tried the following, but it does not seem to work:
| x array | x := GLMPane new. array := WeakArray with: x. x := nil. Smalltalk garbageCollect. array size
==> 1
Arrays never change their size, it is the value of the fisrt slot that changes to 0 or nil (i don't remember). Lukas
Cheers, Doru
-- www.tudorgirba.com
"We cannot reach the flow of things unless we let go."
-- Lukas Renggli www.lukas-renggli.ch
Stupid me: | x array | x := OrderedCollection new. array := WeakArray with: x. x := nil. Smalltalk garbageCollect. array first ==> nil. Ok, this being the case the original question still remains: Is there any effort to make Announcements only use weak references? I am not much of a specialist in this, but I would be first hand interested in helping out. Cheers, Doru On 7 Jan 2011, at 08:00, Lukas Renggli wrote:
On Friday, 7 January 2011, Tudor Girba <tudor.girba@gmail.com> wrote:
Hi,
Are there any plans to get Announcements use weak references?
I saw that in the repository of Lukas, there is a WeakAnnouncer. However, here the subscriptions are still held in a regular Dictionary.
Actually, I am not sure what is the status of weak references. I tried the following, but it does not seem to work:
| x array | x := GLMPane new. array := WeakArray with: x. x := nil. Smalltalk garbageCollect. array size
==> 1
Arrays never change their size, it is the value of the fisrt slot that changes to 0 or nil (i don't remember).
Lukas
Cheers, Doru
-- www.tudorgirba.com
"We cannot reach the flow of things unless we let go."
-- Lukas Renggli www.lukas-renggli.ch
-- www.tudorgirba.com "In a world where everything is moving ever faster, one might have better chances to win by moving slower."
As far as I remember my announcement implementation uses ActionSequence to represent the actions of an event. You just have to replace these with WeakActionSequence to get the desired behavior. Lukas -- Lukas Renggli (mobile) www.lukas-renggli.ch On 07.01.2011, at 08:10, Tudor Girba <tudor.girba@gmail.com> wrote:
Stupid me:
| x array | x := OrderedCollection new. array := WeakArray with: x. x := nil. Smalltalk garbageCollect. array first
==> nil.
Ok, this being the case the original question still remains: Is there any effort to make Announcements only use weak references? I am not much of a specialist in this, but I would be first hand interested in helping out.
Cheers, Doru
On 7 Jan 2011, at 08:00, Lukas Renggli wrote:
On Friday, 7 January 2011, Tudor Girba <tudor.girba@gmail.com> wrote:
Hi,
Are there any plans to get Announcements use weak references?
I saw that in the repository of Lukas, there is a WeakAnnouncer. However, here the subscriptions are still held in a regular Dictionary.
Actually, I am not sure what is the status of weak references. I tried the following, but it does not seem to work:
| x array | x := GLMPane new. array := WeakArray with: x. x := nil. Smalltalk garbageCollect. array size
==> 1
Arrays never change their size, it is the value of the fisrt slot that changes to 0 or nil (i don't remember).
Lukas
Cheers, Doru
-- www.tudorgirba.com
"We cannot reach the flow of things unless we let go."
-- Lukas Renggli www.lukas-renggli.ch
-- www.tudorgirba.com
"In a world where everything is moving ever faster, one might have better chances to win by moving slower."
Thanks. I will take a look. Cheers, Doru On 7 Jan 2011, at 18:08, Lukas Renggli wrote:
As far as I remember my announcement implementation uses ActionSequence to represent the actions of an event. You just have to replace these with WeakActionSequence to get the desired behavior.
Lukas
-- Lukas Renggli (mobile) www.lukas-renggli.ch
On 07.01.2011, at 08:10, Tudor Girba <tudor.girba@gmail.com> wrote:
Stupid me:
| x array | x := OrderedCollection new. array := WeakArray with: x. x := nil. Smalltalk garbageCollect. array first
==> nil.
Ok, this being the case the original question still remains: Is there any effort to make Announcements only use weak references? I am not much of a specialist in this, but I would be first hand interested in helping out.
Cheers, Doru
On 7 Jan 2011, at 08:00, Lukas Renggli wrote:
On Friday, 7 January 2011, Tudor Girba <tudor.girba@gmail.com> wrote:
Hi,
Are there any plans to get Announcements use weak references?
I saw that in the repository of Lukas, there is a WeakAnnouncer. However, here the subscriptions are still held in a regular Dictionary.
Actually, I am not sure what is the status of weak references. I tried the following, but it does not seem to work:
| x array | x := GLMPane new. array := WeakArray with: x. x := nil. Smalltalk garbageCollect. array size
==> 1
Arrays never change their size, it is the value of the fisrt slot that changes to 0 or nil (i don't remember).
Lukas
Cheers, Doru
-- www.tudorgirba.com
"We cannot reach the flow of things unless we let go."
-- Lukas Renggli www.lukas-renggli.ch
-- www.tudorgirba.com
"In a world where everything is moving ever faster, one might have better chances to win by moving slower."
-- www.tudorgirba.com "Don't give to get. Just give."
let us know.
Thanks.
I will take a look.
Cheers, Doru
On 7 Jan 2011, at 18:08, Lukas Renggli wrote:
As far as I remember my announcement implementation uses ActionSequence to represent the actions of an event. You just have to replace these with WeakActionSequence to get the desired behavior.
Lukas
Yes This is on our plate....I would like igor to have a look at all the weak stuff and after Annoucements
Hi,
Are there any plans to get Announcements use weak references?
I saw that in the repository of Lukas, there is a WeakAnnouncer. However, here the subscriptions are still held in a regular Dictionary.
Actually, I am not sure what is the status of weak references. I tried the following, but it does not seem to work:
| x array | x := GLMPane new. array := WeakArray with: x. x := nil. Smalltalk garbageCollect. array size
==> 1
Cheers, Doru
-- www.tudorgirba.com
"We cannot reach the flow of things unless we let go."
participants (3)
-
Lukas Renggli -
Stéphane Ducasse -
Tudor Girba