Getting Squeak to write Squeak (a feeble effort at LISPY stuff)

Lex Spoon lex at cc.gatech.edu
Mon Nov 17 15:37:32 UTC 2003


Ned Konz <ned at bike-nomad.com> wrote:
> Going a bit further, if you look at the various flavors of #evaluate: you will 
> find some where you can specify a context in which to do the evaluation. For 
> instance, Workspaces hold variable bindings, and will provide them when and 
> if the Compiler needs them (see #bindingOf:).

Right.  If your "context" object has a bindingOf: method, that method
can supply Associations that variables in your text can access.

Also, if you are evaluating in the context of a particular object, you
can specify that to the compiler as well.  Then the compiled code will
be able to access instance variables of that object.


One other thing to consider, by the way, is blocks, the Smalltalk
version of lambda.  I notice that Lisp people like macros so much that
they use them even when blocks would work even better.  Since
macro-style programming is more awkward in Smalltalk (though certainly
doable!), you might want to push harder on blocks, which are extremely
smooth.  They also tend to be easier to debug than uses of evaluate:.


Good luck, and do tell how it goes!  It is always nice to have fresh perspectives!


-Lex



More information about the Squeak-dev mailing list