Strange error output for undefined macros inside macros

Per Bothner per@bothner.com
Fri Feb 2 02:10:00 GMT 2007


Kjetil S. Matheussen wrote:
> Thats really bad. I mentally need low-level macros.

Syntax-case gives you low-level macros.

> Lisp is not worth 
> programming without being able to fiddle with the symbols before 
> evaluating.

The problem is that "fiddling with symbols" is fundamentally
incompatible with lexical scoping.

> But I couldn't understand what was the problem with defmacro in this 
> post: http://sourceware.org/ml/kawa/2006-q4/msg00020.html
> Can you give an example of a case where defmacro might lead to trouble?

Some general links:
http://en.wikipedia.org/wiki/Hygienic_macro
A chapter about hygienic macros:
http://scheme.com/tspl3/further.html#./further:h1

The specific problem in the link I gave is somewhat specific
about Kawa's colon notation, in which : is used treated specially
by the Scheme reader, and the hacks in Kawa to deal with "legacy"
code which treats : as a symbol constituent.  The compatibility
hack works reasonably well when using hygienic macros - because
working on the level of syntax objects, rather than raw symbols,
provides more information to the macro expander.
-- 
	--Per Bothner
per@bothner.com   http://per.bothner.com/



More information about the Kawa mailing list