Blocks from strings

Brian T Rice water at tunes.org
Wed Dec 31 21:05:08 UTC 2003


I should add that this suppose /can/ be added to Squeak relatively easily,
at least *in principle*. The changes consist of:

(1) Extending the Scanner and Parser to allow the ` prefix to message
selectors to cause the parser to apply the message to the resultint parse
nodes for the arguments.

(2) Adding support for a QuoteNode and UnquoteNode for boxing and
unboxing, so to speak, syntactically. These drive a templating system. You
can also add methods to print out the equivalent source to construct the
expressions without macro support in the other smalltalk system / context,
but this depends on the implementation's implementation of ParseNodes.

(3) Adding syntax manipulation methods to ParseNode and its progreny. This
is actually the easiest part.

Now you have a non-C-preprocessor equivalent for code templates.

An alternative is to re-use the Refactoring Browser system for pattern-
matching and substitution of Smalltalk code, which is more complicated but
already exists (is ported). However it is also not standard, and not
suited as I recall for making just blocks instead of full methods.

-- 
Brian T. Rice
LOGOS Research and Development
http://tunes.org/~water/



More information about the Squeak-dev mailing list