[BUG] Smalltlk addToStartUpList: NewClass

Daniel V. Oppenheim music at watson.ibm.com
Fri Apr 20 18:05:04 UTC 2001


At 09:07 AM 4/20/01 -0700, you wrote:


>"Daniel V. Oppenheim" wrote:
> >
> > Turns out that if you want a new class to get notified on StartUp (such as
> > for initializing a new MidiPlugin), sending <Smalltalk addToStartUpList:
> > NewClass> does NOT work. By default the NewClass is put at the end of the
> > list -- which is what one would expect. BUT, the StarrtUp list iteration is
> > abandoned either after SecurityManager or AutoStart, so NewClass is never
> > iterated (this is in: <SystemDictionary send: startUpOrShutDown
>
>Hmm, I just tried it with a class and
>
>startUp
>         "Smalltalk addToStartUpList: Test"
>         Transcript show: 'Test started'; cr
>
>The method has to be implemented on the class side and is spelled
>"startUp". Sounds silly, but, implementing a method "startup" caused me
>to scratch my head for a while when I implemented the AutoStart/Launcher
>stuff  8-\
>
>Do you run Squeak inside a browser or standalone?
>
>Michael
>
>--
>  "To improve is to change, to be perfect is to change often."
>                                             Winston Churchill
>+------------------------------------------------------------+
>| Michael Rueger    m.rueger at acm.org      ++1 (310) 937 7196 |
>+------------------------------------------------------------+


Mike

You are right in the sense that Behavior implements <startUp: resuming> as 
<self startUp>, and that a subclass (still on the class side) can override 
startUp. However (1) this doesn't change the fundamental problem in 
SystemDictionary (i.e. Smalltalk) -- the last class (or 2) on the StartUp 
list do NOT GET CALLED upon system start-up. Just for fun I verified this 
with a new class -- it's startUp method does NOT get called; and besides 
(2) you loose the 'resuming' variable if you happen to need it.

I'm appending a fileout of (1) a class FOO that registeres itself and 
informs upon startup, and (2) a change to SystemDictionary that will print 
on the Transcript all classes it processes in the list (seems safe, but you 
may not want to save the image until you remove this change). If your 
system does throw the Notifier -- PLEASE LET ME KNOW.

My system is: Squeak3.1alpha last update: 3910.

Danny Oppenheim


-------------- next part --------------
A non-text attachment was scrubbed...
Name: SystemDictionary-sendtoClassesNamedInwith.st
Type: application/octet-stream
Size: 1178 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20010420/a2949e39/SystemDictionary-sendtoClassesNamedInwith.obj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Foo.st
Type: application/octet-stream
Size: 639 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20010420/a2949e39/Foo.obj
-------------- next part --------------
---

Dr. Daniel V. 
Oppenheim 

	Computer Music Center
	IBM T.J. Watson Research Center	     phone: (914) 945-1989
	P. O. Box 218 (or Route 134)	     fax:   (914) 945-3434
	Yorktown Heights, NY 10598	     www.research.ibm.com/music



More information about the Squeak-dev mailing list