[ENH request] self class.
Lukas Renggli
renggli at iam.unibe.ch
Thu Oct 14 13:06:28 UTC 2004
>> Would it be possible to rename the primitive Object>>class to
>> Object>>basicClass, and then implement Object>>class as:
>
> In many Smalltalks, you can't override #class. Squeak is one of those
> --
> you can comment out the primitive call in Object >> #class, and
> everything
> still works fine. The compiler short-circuits the message, and just
> answers
> the class (or something like that).
I once did something similar: you can remove #class from the
special-selectors collection in the compiler (class-var StdSelectors in
ParseNode). From then on all methods you compile actually send the
message #class and therefor it can also be overridden.
Cheers,
Lukas
--
Lukas Renggli
http://www.lukas-renggli.ch
More information about the Squeak-dev
mailing list
|