yes yes, the dispatching is done :3, i used it at least in 3 times, and works great!
the meaning of the
self announce: [ StackPush new ] ifAnyIsInteresetedIn: StackPush.
is something like,
self announce: aBlock ifAnyIsInteresetedIn: anAnnouncementSubtype.
then
sub := subscriptors interestedIn: anAnnouncementSubype
sub size > 0 ifTrue: [
��� realAnnounce := aBlock value.
]
The thing is, with stack announcements i'll have at least the double of announcement instantiation than message sents. (push & pop). There are a lot of announcements in a simple expression. It could be useful to get lazy instantiation of the announcement?
Yep, announcement -> subscriptions
Hi,
No.. dispatch of events to those who are interested is already done.
On Jun 5, 2012, at 6:17 AM, Santiago Bragagnolo wrote:
> � Hi All!
>
> � Im adding an announcer in my project, 'cause, in order to build a call graph, ill need to know about inferencer-stack movements. �I was thinking, the meaning of it is to create an announcement object with it configuration for any push or pop of a stack that's similar to the runtime stack, these are a lots lots lots of objects proably with lesser optimization than BlockClosure. I was thinking in add extension methods that allow me something like
>
> self announce: [ StackPush new ] ifAnyIsInteresetedIn: StackPush.
>
>
> Well, i have two questions:
>
> a) Am i right?
when you suscribe using #on: anAnnouncement do: ..., or #on: anAnnouncement send: ... to: ... you are already declaring "I'm interested on anAnnouncement", and the dispatcher delivers appropriately.
a dictionary of what? announcement->suscriptions?
> b) subscriptions variable at SubscriptionRegistry is an OrderedCollection, but is commonly accessed to get the subscriptors related with some concrete type, why not a Dictionary? is not faster than an OrderCollection in the tipical case of use? Ok, it could complicate calls like 'remove: subscriptor' but, commonly if you have the subscriptor, you have the Announcement type. Maybe the common ammount of subscriptors in a announcer is too little?
Esteban
>
> Thanks!
>
>
>