[pro] Compiler APIs in Common Lisp

Matthew D. Swank akopa at charter.net
Tue Apr 12 23:21:52 UTC 2011


On 04/12/2011 01:29 PM, Pascal Costanza wrote:
> And then, from a different angle, Common Lisp already provides environment objects and local macro definitions, and they already allow you to go a very long way.
Yes, they do, but since the *macrolet forms aren't top level it's harder
to get good ide (well, slime) support for debugging them. 

For example, one technique I use when building a compile time language
is to have all my context sensitive operators defined as top level
macros that initially signal errors. Each operator gets redefined by
macrolet when the expansion is in a context where the operation is
valid.  A simple example is here:
http://paste.lisp.org/+2LPI

You need macroexpand-all to get the proper expansion of a redefined
(actually shadowed) operator.

However, perhaps this is a quibble related to my use of stone tools for
Lisp development :).

Matt




More information about the pro mailing list