announcements and weak references

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

announcements and weak references

Tudor Girba
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."




Reply | Threaded
Open this post in threaded view
|

Re: announcements and weak references

Lukas Renggli
On Friday, 7 January 2011, Tudor Girba <[hidden email]> 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

Reply | Threaded
Open this post in threaded view
|

Re: announcements and weak references

Tudor Girba
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 <[hidden email]> 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."




Reply | Threaded
Open this post in threaded view
|

Re: announcements and weak references

Lukas Renggli
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 <[hidden email]> 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 <[hidden email]> 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."
>
>
>
>

Reply | Threaded
Open this post in threaded view
|

Re: announcements and weak references

Tudor Girba
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 <[hidden email]> 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 <[hidden email]> 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."






Reply | Threaded
Open this post in threaded view
|

Re: announcements and weak references

Stéphane Ducasse
In reply to this post by Tudor Girba
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."
>
>
>
>


Reply | Threaded
Open this post in threaded view
|

Re: announcements and weak references

Stéphane Ducasse
In reply to this post by Tudor Girba
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