[squeak-dev] System change notifications & Smalltalk(Image)

Levente Uzonyi leves at elte.hu
Tue Aug 31 21:44:39 UTC 2010


On Tue, 31 Aug 2010, Nicolas Cellier wrote:

> 2010/8/31 Eliot Miranda <eliot.miranda at gmail.com>:
>> Hi All,
>>     I have just found out why some recent images of ours at Teleplace aren't
>> logging doits; the system notifications are missing Smalltalk as a target.
>>  If you look at senders of
>> SystemChangeNotifier>>notify:ofAllSystemChangesUsing: in trunk you'll see
>> the following three key senders (ignoring tests)
>>     ChangeSet class>>newChanges:          - ensures change sets keep up to
>> date with changes
>>     Preferences class>>registerForEvents  - ensures prefs stay up to date
>> when methods with preference method tags get added/removed
>>     Utilities class>>startUp                        - ensures recent
>> submissions are maintained
>> SmalltalkImage is conspicuously absent, yet
>> | | am |
>> am := (SystemChangeNotifier uniqueInstance instVarNamed: 'eventSource')
>> actionMap.
>> am keys select:
>> [:k| | e |
>> (e := am at: k) isArray
>> ifTrue: [e anySatisfy: [:seq| seq receiver == Smalltalk]]
>> ifFalse: [e receiver == Smalltalk]]
>> #(#protocolRenamedEvent: #methodModifiedEvent: #protocolAddedEvent:
>> #categoryRemovedEvent: #expressionDoItEvent: #methodRemovedEvent:
>> #classReorganizedEvent: #protocolModifiedEvent: #categoryModifiedEvent:
>> #classRenamedEvent: #protocolRemovedEvent: #classRemovedEvent:
>> #classAddedEvent: #categoryRenamedEvent: #classModifiedEvent:
>> #methodRecategorizedEvent: #classCommentedEvent: #methodAddedEvent:
>> #classRecategorizedEvent: #categoryAddedEvent:)
>> | am |
>> am := (SystemChangeNotifier uniqueInstance instVarNamed: 'eventSource')
>> actionMap.
>> am keys reject:
>> [:k| | e |
>> (e := am at: k) isArray
>> ifTrue: [e anySatisfy: [:seq| seq receiver == Smalltalk]]
>> ifFalse: [e receiver == Smalltalk]]
>> #(#methodReorganizedEvent: #methodCommentedEvent: #methodDoItEvent:
>> #categoryRecategorizedEvent: #methodRenamedEvent:)
>> and there's the rub.  Why isn't Smalltalk a target of all events?  Why does
>> it exclude #methodReorganizedEvent: #methodCommentedEvent: #methodDoItEvent:
>> #categoryRecategorizedEvent: #methodRenamedEvent:?  Is this merely accident?
>> I'm pretty sure that SmalltalkImage class>>startUp needs to ensure system
>> notifications are up-to-date, but are the above exclusions missing for any
>> reason?  It's kind of hard to figure out (see below).  I *think* that it
>> should read
>> SmalltalkImage class>>startUp
>> "XXXX: This is broken. SmalltalkImage startUp happens quite late in the
>> startup sequence; earlier startups may very well need the information about
>> the endianness of the platform."
>> EndianCache := nil.
>> SystemChangeNotifier uniqueInstance notify: Smalltalk
>> ofAllSystemChangesUsing: #event:
>> but I thought I'd check with y'all.
>> and finally when can we reimplement this entire mess using e.g.
>> Anouncements, I mean:
>> AbstractEvent>>eventSelector
>> ^self class eventSelectorBlock value: itemKind value: self changeKind
>> AbstractEvent class>>eventSelectorBlock
>> ^[:itemKind :changeKind | itemKind, changeKind, 'Event:']
>> Surely this is too direct and easy to understand ;)  I mean who /needs/
>> senders and implementors to work?
>> grrr....
>> Eliot
>>
>
> Much too easy indeed, it would be me, there would be arithmetic on
> char codes in between.
> Didn't Pharo made any progress wrt Annoucements ?

AFAIK they were just talking about it, but we made a first stab:
http://forum.world.st/SystemChangeNotifier-and-Announcements-td1568311.html
http://www.squeaksource.com/SysChangeAnnouncer.html


Levente

>
> Nicolas
>
>


More information about the Squeak-dev mailing list