Recompilation (was: Re: Tips and tricks?)

Avi Bryant avi at beta4.com
Wed Mar 10 21:10:36 UTC 2004


On Mar 10, 2004, at 12:58 PM, Andreas Raab wrote:
>  For example, you might *easily* stick that slot into a
> dictionary (such as Morph's extensions) and simply tell the compiler 
> that
> what it should do when it sees the name "foo" is to send messages like 
> #foo
> and #foo:. At which point, when you load the package you merely tell 
> the
> compiler about that "variable" so the compiler knows what to do when it
> comes across the places where foo is used, and when you unload it you 
> simply
> remove the methods (if you want to be pedantic you can remove the 
> values
> too).

Yes, and it's too bad that our compiler doesn't currently support this 
kind of easy extensibility.  I've thought in the past about having a 
#bindingOf: like facility but where instead of just returning an 
association to be put in as a literal, it returns some object that 
knows how to emit code (as a parse tree? bytecode?) for reads and 
writes.  I guess that's equivalent to "symbol macros" in Common Lisp...




More information about the Squeak-dev mailing list