macro expansion bug?

Wen-Chun Ni wcn@tbcommerce.com
Fri Dec 20 10:36:00 GMT 2002


On Thu, Nov 14, 2002 at 11:04:58AM -0800, Per Bothner wrote:
> Wen-Chun Ni wrote:
> 
> > Is it a bug? Or my understanding of syntax-rules still leaves
> > something to be desired?
> 
> Looks like the handling of (quote x) within macros may be wrong.
> I've found R5RS unclear in this respect in the past.  I'll take
> another look.  Maybe the attempts of the macro machinery to
> "understand" quoatation is unneeded - but I suspect not.

I can't even finish section 4.3 of R5RS. However, when I read 
"Syntactic Abstraction in Scheme", syntax-rules is obviously
a special form of syntax-case with syntax acting as the 'quote'.
The regular Scheme's (quote x) doesn't "block" the "evaluation"
in this case because the symbol 'result' here is a pattern 
variable. The paper's explanation (page 9) in the paragraph after

   (syntax template)

said that 
(quote

A syntax form returns a Scheme object in much the same way as quote
or quasiquote, with two important differences: the value of pattern
variables appearing within template are inserted into template ....
)

If I read it correctly, the x in (quote x) must be evaluated by 
the expander if x is a pattern variable.

It's a pity that I am new to both Kawa and Scheme. Otherwise, I'll
try to help because, in larger scale, I do think syntax-case and
related things like datum->syntax-object  need to be implemented
in order for the macro system to be useful. However, as a sole
maintainer, Per is obviously overworked. I can't ask much.



Wen-Chun



More information about the Kawa mailing list