Re: [Pharo-dev] SystemAnnouncer api question
https://pharo.fogbugz.com/default.asp?10781 On 28 May 2013 04:53, Igor Stasenko wrote: > On 27 May 2013 19:05, stephane ducasse wrote: >> Igor >> >> can you add a bug entry and propose a fix? >> So that we do not forget. >> > yes. > >> Stef >> >> >> >> >>> Hi guys >>> >>> why there is no variant to on:send:to: >>> "SystemAnnouncer uniqueInstance on: AddedLog send: #foo to: self. " >>> that pass also the announcement? >>> >>> Just because it is better to use on:do;? >>> >>> Stef >>> >> Huh? >> It should work do do >> SystemAnnouncer uniqueInstance on: AddedLog send: #foo: to: self >> >> and get the announcement as argument… >> >> or #foo:bar: >> to get the announcer as well as the announcement. >> >> This is one of the reasons cull: is cool! ;) >> >> Cheers, >> Henry >> > > Speaking of SystemAnnouncer… > In the latest dev image I've got: > SystemAnnouncer uniqueInstance numberOfSubscriptions 1327 > > Most of which are weak subscriptions for RecentMessageList. > > RecentMessageList class >> cleanUp > >self allInstancesDo: [:rml| rml initialize]. > > is clearly wrong, as initialize registers subscriptions for the > announcements (thus introducing duplicates), done every time you shut > down the image… > > maybe it should do > self resetUniqueInstance instead? > i think RecentMessageList>>registerToAnnouncements should include SystemAnnouncer uniqueInstance unsubscribe: self. like that, even if you call #initialize multiple times, it won't create duplicates. >>> >>> tried it, with the change: >>> >>> SystemAnnouncer uniqueInstance numberOfSubscriptions 467 >>> >>> RecentMessageList cleanUp >>> >>> SystemAnnouncer uniqueInstance numberOfSubscriptions 93 >>> -- Best regards, Igor Stasenko. >>> >>> >>> >>> -- >>> Best regards, >>> Igor Stasenko. >>> >> >> > > > > -- > Best regards, > Igor Stasenko. -- Best regards, Igor Stasenko.
Re: [Pharo-dev] SystemAnnouncer api question
On 27 May 2013 19:05, stephane ducasse wrote: > Igor > > can you add a bug entry and propose a fix? > So that we do not forget. > yes. > Stef > > > > >> Hi guys >> >> why there is no variant to on:send:to: >> "SystemAnnouncer uniqueInstance on: AddedLog send: #foo to: self. " >> that pass also the announcement? >> >> Just because it is better to use on:do;? >> >> Stef >> > Huh? > It should work do do > SystemAnnouncer uniqueInstance on: AddedLog send: #foo: to: self > > and get the announcement as argument… > > or #foo:bar: > to get the announcer as well as the announcement. > > This is one of the reasons cull: is cool! ;) > > Cheers, > Henry > Speaking of SystemAnnouncer… In the latest dev image I've got: SystemAnnouncer uniqueInstance numberOfSubscriptions 1327 Most of which are weak subscriptions for RecentMessageList. RecentMessageList class >> cleanUp self allInstancesDo: [:rml| rml initialize]. is clearly wrong, as initialize registers subscriptions for the announcements (thus introducing duplicates), done every time you shut down the image… maybe it should do self resetUniqueInstance instead? >>> >>> i think >>> RecentMessageList>>registerToAnnouncements >>> >>> should include >>> >>> SystemAnnouncer uniqueInstance unsubscribe: self. >>> >>> >>> like that, even if you call #initialize multiple times, it won't >>> create duplicates. >>> >> >> tried it, with the change: >> >> SystemAnnouncer uniqueInstance numberOfSubscriptions 467 >> >> RecentMessageList cleanUp >> >> SystemAnnouncer uniqueInstance numberOfSubscriptions 93 >> >>> -- >>> Best regards, >>> Igor Stasenko. >> >> >> >> -- >> Best regards, >> Igor Stasenko. >> > > -- Best regards, Igor Stasenko.
Re: [Pharo-dev] SystemAnnouncer api question
Simpler is better: "Declare that when anAnnouncementClass is raised, anObject should receive the message aSelector. When the message expects one argument (eg #fooAnnouncement:) the announcement is passed as argument. When the message expects two arguments (eg #fooAnnouncement:announcer:) both the announcement and the announcer are passed as argument" And is it not when an an announcement of anAnnouncementClass is raised, .. ? Announcements are instances. On 27 May 2013, at 19:03, stephane ducasse wrote: >> >>> Hi guys >>> >>> why there is no variant to on:send:to: >>> "SystemAnnouncer uniqueInstance on: AddedLog send: #foo to: self. " >>> that pass also the announcement? >>> >>> Just because it is better to use on:do;? >>> >>> Stef >>> >> Huh? >> It should work do do >> SystemAnnouncer uniqueInstance on: AddedLog send: #foo: to: self >> >> and get the announcement as argument… > > Ok now of course since there is a nice comment in the method explaining it I > could have read it :( > I will try to write one. > > so is this one correct > "Declare that when anAnnouncementClass is raised, anObject should > receive the message aSelector. > When the message is excepting one argument (eg #fooAnnouncement:) the > announcement is passed as argument. > When the message is exception two arguments (eg > #fooAnnouncement:announcer:) the announcement and the annoncer > are passed as argument" > >> >> or #foo:bar: >> to get the announcer as well as the announcement. >> >> This is one of the reasons cull: is cool! ;) >> >> Cheers, >> Henry >> > >
Re: [Pharo-dev] SystemAnnouncer api question
Igor can you add a bug entry and propose a fix? So that we do not forget. Stef > Hi guys > > why there is no variant to on:send:to: > "SystemAnnouncer uniqueInstance on: AddedLog send: #foo to: self. " > that pass also the announcement? > > Just because it is better to use on:do;? > > Stef > Huh? It should work do do SystemAnnouncer uniqueInstance on: AddedLog send: #foo: to: self and get the announcement as argument… or #foo:bar: to get the announcer as well as the announcement. This is one of the reasons cull: is cool! ;) Cheers, Henry >>> >>> Speaking of SystemAnnouncer… >>> In the latest dev image I've got: >>> SystemAnnouncer uniqueInstance numberOfSubscriptions 1327 >>> >>> Most of which are weak subscriptions for RecentMessageList. >>> >>> RecentMessageList class >> cleanUp >>> >>>self allInstancesDo: [:rml| rml initialize]. >>> >>> is clearly wrong, as initialize registers subscriptions for the >>> announcements (thus introducing duplicates), done every time you shut down >>> the image… >>> >>> maybe it should do >>> self resetUniqueInstance instead? >>> >> >> i think >> RecentMessageList>>registerToAnnouncements >> >> should include >> >> SystemAnnouncer uniqueInstance unsubscribe: self. >> >> >> like that, even if you call #initialize multiple times, it won't >> create duplicates. >> > > tried it, with the change: > > SystemAnnouncer uniqueInstance numberOfSubscriptions 467 > > RecentMessageList cleanUp > > SystemAnnouncer uniqueInstance numberOfSubscriptions 93 > >> -- >> Best regards, >> Igor Stasenko. > > > > -- > Best regards, > Igor Stasenko. >
Re: [Pharo-dev] SystemAnnouncer api question
> >> Hi guys >> >> why there is no variant to on:send:to: >> "SystemAnnouncer uniqueInstance on: AddedLog send: #foo to: self. " >> that pass also the announcement? >> >> Just because it is better to use on:do;? >> >> Stef >> > Huh? > It should work do do > SystemAnnouncer uniqueInstance on: AddedLog send: #foo: to: self > > and get the announcement as argument… Ok now of course since there is a nice comment in the method explaining it I could have read it :( I will try to write one. so is this one correct "Declare that when anAnnouncementClass is raised, anObject should receive the message aSelector. When the message is excepting one argument (eg #fooAnnouncement:) the announcement is passed as argument. When the message is exception two arguments (eg #fooAnnouncement:announcer:) the announcement and the annoncer are passed as argument" > > or #foo:bar: > to get the announcer as well as the announcement. > > This is one of the reasons cull: is cool! ;) > > Cheers, > Henry >
Re: [Pharo-dev] SystemAnnouncer api question
On 27 May 2013 12:28, Henrik Johansen wrote: > > On May 27, 2013, at 11:44 AM, Henrik Johansen wrote: > >> >> On May 25, 2013, at 1:11 PM, Stéphane Ducasse wrote: >> >>> Hi guys >>> >>> why there is no variant to on:send:to: >>> "SystemAnnouncer uniqueInstance on: AddedLog send: #foo to: self. " >>> that pass also the announcement? >>> >>> Just because it is better to use on:do;? >>> >>> Stef >>> >> Huh? >> It should work do do >> SystemAnnouncer uniqueInstance on: AddedLog send: #foo: to: self >> >> and get the announcement as argument… >> >> or #foo:bar: >> to get the announcer as well as the announcement. >> >> This is one of the reasons cull: is cool! ;) >> >> Cheers, >> Henry >> > > Speaking of SystemAnnouncer… > In the latest dev image I've got: > SystemAnnouncer uniqueInstance numberOfSubscriptions 1327 > > Most of which are weak subscriptions for RecentMessageList. > > RecentMessageList class >> cleanUp > > self allInstancesDo: [:rml| rml initialize]. > > is clearly wrong, as initialize registers subscriptions for the announcements > (thus introducing duplicates), done every time you shut down the image… > > maybe it should do > self resetUniqueInstance instead? > i think RecentMessageList>>registerToAnnouncements should include SystemAnnouncer uniqueInstance unsubscribe: self. like that, even if you call #initialize multiple times, it won't create duplicates. -- Best regards, Igor Stasenko.
Re: [Pharo-dev] SystemAnnouncer api question
On 27 May 2013 16:21, Igor Stasenko wrote: > On 27 May 2013 12:28, Henrik Johansen wrote: >> >> On May 27, 2013, at 11:44 AM, Henrik Johansen wrote: >> >>> >>> On May 25, 2013, at 1:11 PM, Stéphane Ducasse wrote: >>> Hi guys why there is no variant to on:send:to: "SystemAnnouncer uniqueInstance on: AddedLog send: #foo to: self. " that pass also the announcement? Just because it is better to use on:do;? Stef >>> Huh? >>> It should work do do >>> SystemAnnouncer uniqueInstance on: AddedLog send: #foo: to: self >>> >>> and get the announcement as argument… >>> >>> or #foo:bar: >>> to get the announcer as well as the announcement. >>> >>> This is one of the reasons cull: is cool! ;) >>> >>> Cheers, >>> Henry >>> >> >> Speaking of SystemAnnouncer… >> In the latest dev image I've got: >> SystemAnnouncer uniqueInstance numberOfSubscriptions 1327 >> >> Most of which are weak subscriptions for RecentMessageList. >> >> RecentMessageList class >> cleanUp >> >> self allInstancesDo: [:rml| rml initialize]. >> >> is clearly wrong, as initialize registers subscriptions for the >> announcements (thus introducing duplicates), done every time you shut down >> the image… >> >> maybe it should do >> self resetUniqueInstance instead? >> > > i think > RecentMessageList>>registerToAnnouncements > > should include > > SystemAnnouncer uniqueInstance unsubscribe: self. > > > like that, even if you call #initialize multiple times, it won't > create duplicates. > tried it, with the change: SystemAnnouncer uniqueInstance numberOfSubscriptions 467 RecentMessageList cleanUp SystemAnnouncer uniqueInstance numberOfSubscriptions 93 > -- > Best regards, > Igor Stasenko. -- Best regards, Igor Stasenko.
Re: [Pharo-dev] SystemAnnouncer api question
On May 27, 2013, at 11:44 AM, Henrik Johansen wrote: > > On May 25, 2013, at 1:11 PM, Stéphane Ducasse wrote: > >> Hi guys >> >> why there is no variant to on:send:to: >> "SystemAnnouncer uniqueInstance on: AddedLog send: #foo to: self. " >> that pass also the announcement? >> >> Just because it is better to use on:do;? >> >> Stef >> > Huh? > It should work do do > SystemAnnouncer uniqueInstance on: AddedLog send: #foo: to: self > > and get the announcement as argument… > > or #foo:bar: > to get the announcer as well as the announcement. > > This is one of the reasons cull: is cool! ;) > > Cheers, > Henry > Speaking of SystemAnnouncer… In the latest dev image I've got: SystemAnnouncer uniqueInstance numberOfSubscriptions 1327 Most of which are weak subscriptions for RecentMessageList. RecentMessageList class >> cleanUp self allInstancesDo: [:rml| rml initialize]. is clearly wrong, as initialize registers subscriptions for the announcements (thus introducing duplicates), done every time you shut down the image… maybe it should do self resetUniqueInstance instead? Cheers, Henry
Re: [Pharo-dev] SystemAnnouncer api question
On May 25, 2013, at 1:11 PM, Stéphane Ducasse wrote: > Hi guys > > why there is no variant to on:send:to: > "SystemAnnouncer uniqueInstance on: AddedLog send: #foo to: self. " > that pass also the announcement? > > Just because it is better to use on:do;? > > Stef > Huh? It should work do do SystemAnnouncer uniqueInstance on: AddedLog send: #foo: to: self and get the announcement as argument… or #foo:bar: to get the announcer as well as the announcement. This is one of the reasons cull: is cool! ;) Cheers, Henry
Re: [Pharo-dev] SystemAnnouncer api question
probably my fault ;) but can be implemented, there no reason for the restriction. Esteban On May 25, 2013, at 1:11 PM, Stéphane Ducasse wrote: > Hi guys > > why there is no variant to on:send:to: > "SystemAnnouncer uniqueInstance on: AddedLog send: #foo to: self. " > that pass also the announcement? > > Just because it is better to use on:do;? > > Stef >