[squeak-dev] Self-style environments

Tony Garnock-Jones tonyg at leastfixedpoint.com
Wed Mar 24 20:14:24 UTC 2021


Hi all,

In playing with Environments today, I found myself building a subclass 
of Environment with the following method in it:

   doesNotUnderstand: aMessage
     aMessage numArgs = 0 ifFalse: [^ super doesNotUnderstand: aMessage].
     ^ self valueOf: aMessage selector ifAbsent: [
         ^ super doesNotUnderstand: aMessage]

Then, having constructed and set up some environment `e`, using the 
Browser to create classes X and Y in it, I can install it as a global:

   Smalltalk at: #E put: e

and from then on I can say

   x := E X new.
   y := E Y new.

etc.

I can also do this recursively (and in fact cyclically, I think?).

What's missing from this picture is tool support. In particular, 
Monticello support. I'd love to be able to have classes in my 
spliced-into-the-globals environment scanned by MC just like those in 
the toplevel.

I've always found the MC codebase intimidating, however. Would it be 
reasonable to hope to be able to implement support for something like 
this in Monticello?

Regards,
   Tony

PS. squeak : unix :: Smalltalk globals : /, and it's just that Smalltalk 
globals, being a flat namespace, is equivalent to a DOS 1.0 root 
directory without subdirectory support. I guess I'm proposing adding 
subdirectories, bringing Squeak's file-system-analogue into the mid-80s 
DOS 2.0 era??


More information about the Squeak-dev mailing list