<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2722.900" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>The following syntax macro appears to work okay (or
at least</FONT></DIV>
<DIV><FONT size=2>as expected).</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2> > (define-syntax
test<BR> (lambda
(stx)<BR> (syntax-case (list (- 2 1) (+ 1 1)
(+ 2 1)) ()<BR> ((x y
...)<BR>
(begin<BR>
(display
(syntax-object->datum<BR>
(syntax (x y
...))))<BR>
(newline)<BR>
(syntax (list x y ...)))))))<BR> > (test)</FONT></DIV>
<DIV><FONT size=2> (1 2 3) ; output
displayed</FONT></DIV>
<DIV><FONT size=2> (1 2 3) ; returned
value</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>If the (begin ...) expression is unwrapped the
following works</FONT></DIV>
<DIV><FONT size=2>only if two expressions occurs in the clause of the
case.</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>> (define-syntax
test<BR> (lambda
(stx)<BR> (syntax-case (list (- 2 1) (+ 1 1)
(+ 2 1)) ()<BR> ((x y
...)<BR>
(display
(syntax-object->datum<BR>
(syntax (x y ...))))<BR>
;
(newline)<BR>
(syntax (list x y ...))))))<BR> <FONT face=Arial>>
</FONT>(test)</FONT></DIV><FONT face=Arial size=2>
<DIV><FONT size=2> (1 2 3) ; output
displayed</FONT></DIV>
<DIV><FONT size=2> (1 2 3) ; returned
value</FONT></DIV>
<DIV> </DIV>
<DIV>However if the (newline) is uncommented leaving 3 statements in the
case</DIV>
<DIV>clause the following error occurs.</DIV>
<DIV><FONT face=Arial></FONT><FONT face=Arial></FONT> </DIV>
<DIV><FONT face=Arial> syntax-case*: bad clause in: ((x y ...)
(display (syntax-object->datum (syntax (x y ...)))) (newline) (syntax (list x
y ...)))</FONT></DIV>
<DIV><FONT face=Arial></FONT><BR>Is this correct behavior? or is the case
clause broken? I noticed that SISC</DIV>
<DIV>complains in the exact same manner making me thing I have a fundamental
misunderstanding.</DIV>
<DIV><FONT face=Arial></FONT> </DIV>
<DIV><FONT face=Arial>Note: the purpose this macro is simply to investigate the
behavior of expansion time</FONT></DIV>
<DIV>execution of the code related to syntax-case.</DIV>
<DIV><FONT face=Arial></FONT> </DIV>
<DIV><FONT face=Arial></FONT> </DIV></FONT></BODY></HTML>