[pro] The Best Examples of "Code is Data"

Pascal Costanza pc at p-cos.net
Fri Sep 10 14:41:55 UTC 2010


On 7 Sep 2010, at 23:41, Daniel Weinreb wrote:

> It's very, very hard to know what "best macro" means.  It's
> like asking for the "best function".  Perhaps what people
> mean is the "cutest" or "most remarkable" macro.


I was rather amazed when discovering a technique for integrating hygiene-compatible macros into Common Lisp. How to do this is described here: http://www.jucs.org/jucs_16_2/embedding_hygiene_compatible_macros (In the paper, it's described in terms of Scheme, because that's easier to explain, but the 'actual' implementation is in Common Lisp, as also described more superficially in that paper, and also available for download).

I'm not sure that this is actually a practically useful approach, but it surely shows how powerful Common Lisp macros are. (Definitely more powerful than many people think.) The technique in that paper could maybe become more practically useful if it gets integrated directly in a Common Lisp implementation itself. Not that I think that macro hygiene is actually a real problem... ;)


Pascal

-- 
Pascal Costanza, mailto:pc at p-cos.net, http://p-cos.net
Vrije Universiteit Brussel
Software Languages Lab
Pleinlaan 2, B-1050 Brussel, Belgium










More information about the pro mailing list