Optional class extensions

Cees de Groot cg at cdegroot.com
Sat Feb 5 11:25:41 UTC 2005


Something that *might* make life more usable: optional class extensions.

The idea is that for package P, you have class extension method categories  
named *?p... When loading code, a check is done whether the extended class  
exists, if not, the methods are silently skipped.

Why? Well, look for example at Rmt - it extends a list of classes over a  
whole slew of packages with #asCompactBytes. That's, as far as I can see,  
purely an optimization. Breaking Rmt into 'Rmt-Base', 'Rmt-Morphic  
Extensions', 'Rmt-Foo Extensions', ... would mean a lot of work and would  
be, IMO, of little value. Just putting all these optional methods in  
optional method categories lets you file in Rmt into any image, without  
breakage if e.g. Morphic ain't available.

(this occurred to me when trying to load Rmt into a stripped image)



More information about the Squeak-dev mailing list