[ENH request] self class.
Marcus Denker
denker at iam.unibe.ch
Thu Oct 14 19:19:06 UTC 2004
Am 14.10.2004 um 15:11 schrieb Avi Bryant:
>
> On Oct 14, 2004, at 3:06 PM, Lukas Renggli wrote:
>
>>>> 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.
>
> Oh, it's not in the VM - good. Markus, does the new Compiler package
> still have this? Can we get rid of it?
>
>
Yes, the new compiler does the same. We should do some benchmarking to
see if there are any perfomance
problems (I don't think so). The bytecode implementation would I guess
be kept in the vm for some time
for backward-compatibility.
Maybe some status on the new compiler:
-> BytecodeBuilder and IRBuilder understand oldstyle blocks
-> BytecodeDecompiler can decompile code with oldsyle blocks to IR
-> I added simple add/delete/replace to the IR for easy symbolic
manipulation
of Bytecodes at the IR level.
TODO:
-> more on decompilation for oldstyle blocks: IR --> RB-AST
-> test / fix Decompilation of V2 closures Blocks
-> Fix the SemanticTranslator to emit code for oldstyle blocks.
So it will take some more time... but I now really want that stuff in.
It makes everything so
much easier to work with.
Marcus
More information about the Squeak-dev
mailing list
|