On 5 June 2012 06:17, Santiago Bragagnolo <santiagobragagnolo@gmail.com> 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
i am not sure you using right thing for your task. an announcement is an event which you broadcast to subscribers. you can announce any object as announcement.. just make sure your subscription handles it.. i.e. you can use: announcer on: BlockAnnouncement send: #doBlock: to: self if you write: BlockAnnouncement class>>handles: announcement ^ announcement class == BlockClosure Myclass>>doBlock: closure .... do anything you like... x := closure value .. etc So, you can announce like: announcer announce: [ Stack push ]
self announce: [ StackPush new ] ifAnyIsInteresetedIn: StackPush.
Well, i have two questions:
a) Am i right? 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?
Thanks!
-- Best regards, Igor Stasenko.