[Pharo-dev] about Announcement weak on: do:

2013-06-02 Thread Stéphane Ducasse
Hi igor

after our discussions about the fact that we should not use weak with block, I 
checked and 

WeakSubscriptionBuilderon: anAnnouncementClass do: aValuable
^ self subscribe: anAnnouncementClass do: aValuable

Does not look like raising error.

Stef




Re: [Pharo-dev] about Announcement weak on: do:

2013-06-02 Thread Tudor Girba
Indeed, the main reason why announcers were not made weak by default was that 
the weak code only worked for message sends but not for blocks. It would be 
great to have the blocks working, too.

Doru


On Jun 2, 2013, at 2:13 PM, Stéphane Ducasse stephane.duca...@inria.fr wrote:

 Hi igor
 
 after our discussions about the fact that we should not use weak with block, 
 I checked and 
 
 WeakSubscriptionBuilderon: anAnnouncementClass do: aValuable
   ^ self subscribe: anAnnouncementClass do: aValuable
 
 Does not look like raising error.
 
 Stef
 
 

--
www.tudorgirba.com

Presenting is storytelling.




Re: [Pharo-dev] about Announcement weak on: do:

2013-06-02 Thread Igor Stasenko
On 2 June 2013 14:13, Stéphane Ducasse stephane.duca...@inria.fr wrote:
 Hi igor

 after our discussions about the fact that we should not use weak with block, 
 I checked and

 WeakSubscriptionBuilderon: anAnnouncementClass do: aValuable
 ^ self subscribe: anAnnouncementClass do: aValuable

 Does not look like raising error.

yes..
so we need to change it to throw error.

(by making  dirty patch in subscribe: anAnnouncementClass do: aValuable ,
testing if valuable is block)

:)

it is strange.. i remember we wrote code which were throwing error..
Even class comment says it:

I am a wrapper around an Announcer, used to create weak subscriptions
at subscription time.

Use me like this:

anAnnouncer weak subscribe: Announcement send: #foo to: barObject.

I raise an error for block subscriptions, as they require non-existing
Ephemeron support to function correctly.

 Stef



-- 
Best regards,
Igor Stasenko.



Re: [Pharo-dev] about Announcement weak on: do:

2013-06-02 Thread Stéphane Ducasse
can you propose a fix?
+ bug entry :)

Stef
On Jun 2, 2013, at 3:37 PM, Igor Stasenko siguc...@gmail.com wrote:

 On 2 June 2013 14:13, Stéphane Ducasse stephane.duca...@inria.fr wrote:
 Hi igor
 
 after our discussions about the fact that we should not use weak with block, 
 I checked and
 
 WeakSubscriptionBuilderon: anAnnouncementClass do: aValuable
^ self subscribe: anAnnouncementClass do: aValuable
 
 Does not look like raising error.
 
 yes..
 so we need to change it to throw error.
 
 (by making  dirty patch in subscribe: anAnnouncementClass do: aValuable ,
 testing if valuable is block)
 
 :)
 
 it is strange.. i remember we wrote code which were throwing error..
 Even class comment says it:
 
 I am a wrapper around an Announcer, used to create weak subscriptions
 at subscription time.
 
 Use me like this:
 
 anAnnouncer weak subscribe: Announcement send: #foo to: barObject.
 
 I raise an error for block subscriptions, as they require non-existing
 Ephemeron support to function correctly.
 
 Stef
 
 
 
 -- 
 Best regards,
 Igor Stasenko.