Subclassing vs. Composing [was: Having brains again after being headless?]

Tim Rowledge tim at sumeru.stanford.edu
Sun Dec 15 02:16:14 UTC 2002


On Saturday, December 14, 2002, at 09:16  AM, Anthony Hannan wrote:

> Tim Olson <tim at io.com> wrote:
>> I can't remember if this was answered previously in this thread, but
>> what are the reasons for having Interpreter be a subclass of
>> ObjectMemory, as opposed to having an instance variable which is an
>> ObjectMemory?
>
> Because the VM code is translated to C which has no objects.  All
> ObjectMemory and Interpreter variables become globals and sends to
> 'self' are intepreted as a regular function calls.
I think it was simply an artifact of the original version of the 
CCodeGenerator; once things like BitBltSimulation etc were introduced 
(and interpreterProxy methds got converted to direct calls) it would 
have been possible to seperate them but nobody felt like doing the 
work. It's way past time that a lot of Slang stuff got rewritten. 
Currently there are four different sets of semantics involved in code 
that ends up in the core vm or plugins. T'would be nice to reduce it a 
bit.

tim
-- 
tim at sumeru.stanford.edu




More information about the Squeak-dev mailing list