[Etoys] Translations

Bert Freudenberg bert at freudenbergs.de
Sun Jul 15 06:13:23 EDT 2007


On Jul 15, 2007, at 4:09 , Yoshiki Ohshima wrote:

>> Yet another step would be to re-implement #translated to take into
>> account the location of the sender. This could be performance-
>> critical, as "thisContext sender" gets you only the compiled method
>> but not the class or selector of the method. Probably the translator
>> should have a cache keyed by compiled method and string, but the
>> details might be tricky.
>
>   Just an idea, but a Compiler hack that compiles:
>
>  'abc' translated
>
> to:
>
>   'abc' translatedFor: aClass
>
> might work.  The aClass may be a Symbol, or a class category.

I don't think we need that much magic ;)

We do not need the actual class and selector of the method that sent  
#translated. Class category is sufficient for the lookup, right?

We know thisContext sender's class already, so the right class  
category must be the category of the sender's class, or one of its  
superclasses. That should be sufficient and reasonably fast, since I  
doubt there would be more than two or three different class  
categories involved in a given superclass chain.

- Bert -





More information about the Etoys mailing list