Some questions about Squeak
Stephane Ducasse
ducasse at iam.unibe.ch
Sun Nov 28 18:44:34 UTC 1999
> No! Don't do it that way!
> It is definetely not recommended to implement :
>
> new
> ^super new initialize
>
> in a class and its subclass, because initialize will be sent
> twice (several times) to the same object. The super call
> makes no difference here because the item returned by
> super new does not know about it anymore.
Thanks I already know.
> So it is pretty easy to solve your problem without patching
> the VM. It suffices to implement:
Defining something into Object class is not good.
The class behavior is inherited from Behavior
This is Behavior that new should be redefine to call initialize
> Object class>>new
> "Just do it here so my subclasses need not do it"
> ^super new initialize
>
> Wait! Don't forget to implement first:
>
> Object>>inititalize
> "Do nothing"
> ^self.
>
>
>
More information about the Squeak-dev
mailing list
|