Traits status

Tony Garnock-Jones tonyg at lshift.net
Tue Oct 25 13:19:00 UTC 2005


Thanks for the guidelines, Colin! It's exactly the kind of thing I'm 
interested in: the details of the interface to the VM; the fine points 
are difficult to extract from reading the source to the core classes.

Regards,
   Tony

Colin Putney wrote:
> Well, getting started is easy. Just develop your new classes as  ususal. 
> The tricky bits only come when you want to create instances  of them. In 
> my case, I used a class name prefix of CM to distinguish  my sandbox 
> from the core system. I just implemented CMBehavior,  CMClass, 
> CMMetaclass and so on. Then I wrote a little importer that  would first 
> create the core sandbox - nil, ProtoObject, Object and  their 
> metaclasses - and then import a set of packages into the sandbox.
> 
> Gotchas to look out for:
> 
> - behaviors must have the following as the first three instance  
> variables: "superclass methodDictionary format".
> 
> - every object must be able to respond to at least one method,  
> #doesNotUnderstand: if you try to send a message to an object with no  
> methods at all, the VM will shut down in disgust.
> 
> - there's an anomaly where the metaclass hierarchy "wraps around" and  
> becomes normal classes. For example, have a look at the difference  
> between "ProtoObject superclass" and "ProtoObject class superclass".
> 
> And that's it. Have fun!



More information about the Squeak-dev mailing list