<!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.6000.16587" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff background="">
<DIV><FONT face="Courier New" size=2>The following is extracted and simplified
as much as possible from a bigger piece of code.</FONT></DIV>
<DIV><FONT face="Courier New" size=2>Sorry that I could not condence it any
further.<BR><BR>; file lazy.ss
----------------------------------------<BR>(module lazy
mzscheme<BR> (provide lazy)<BR> (define module-name (gensym
'module-name-lazy-))<BR> <BR> (define-syntax lazy<BR>
(syntax-rules ()<BR> ((lazy expr) (lazy/proc
'expr))))<BR> <BR> (define (lazy/proc expr)<BR> (let/cc
cc<BR> </FONT><FONT size=2><FONT face="Courier New"><FONT
color=#ff0000>(eval<BR> `(module ,module-name
<BR> "lazy-language.ss"<BR> ,cc
,expr))</FONT>))<BR> <BR> ; inorder to make require
superfluous<BR> (lazy/proc 'initialize)<BR> (eval
`(require ',module-name)))</FONT></FONT></DIV>
<DIV><FONT face="Courier New" size=2> ; module name quoted for
3.99.0.9<BR><BR>; file lazy-language.ss
---------------------------------<BR>(module lazy-language
mzscheme<BR> (provide macro scheme</FONT></DIV>
<DIV><FONT face="Courier New" size=2> (rename mod-begin
#%module-begin)</FONT></DIV>
<DIV><FONT face="Courier New" size=2> (rename #%datum #%top)) ; allow free
vars<BR> <BR> (define-syntax (macro stx) <BR> (syntax-case stx
()<BR> ((_ (id keywords rule ...) ... expr)<BR>
#'(letrec-syntaxes<BR> (((id ...) (#%app values
(syntax-rules keywords rule ...) ...)))<BR>
expr))))<BR> <BR> (define-syntax scheme<BR> (syntax-rules
()<BR> ((_ x) (#%app eval 'x))<BR> ((_ x y ...) (#%app
(#%app eval 'x) y ...))))<BR><BR> (define-syntax mod-begin<BR>
(syntax-rules ()<BR> ((_ cont x)<BR>
(#%module-begin<BR> (#%app (#%datum . cont)
x))))))<BR><BR>; using the above -------------------------</FONT></DIV>
<DIV><FONT face="Courier New" size=2>; definitions window<BR>(require "lazy.ss"
)</FONT></DIV>
<DIV><FONT face="Courier New" size=2></FONT> </DIV>
<DIV><FONT face="Courier New" size=2>(lazy<BR> (macro (a () ((a x y)
(scheme list x y)))<BR> (a p q))) ; --> (p q) ok</FONT></DIV>
<DIV><FONT face="Courier New" size=2></FONT> </DIV>
<DIV><FONT face="Courier New" size=2>(lazy<BR> (macro (a () ((a x ...)
(scheme list x ...)))<BR> (a p q))) ; --> (p q) ok</FONT></DIV>
<DIV><FONT face="Courier New" size=2></FONT> </DIV>
<DIV><FONT face="Courier New" size=2>(lazy<BR> (macro (a () ((a x ...)
(scheme list x ...)))<BR> (a p q r))) ; --> error: a: bad syntax in: (a
p q r)</FONT></DIV>
<DIV><FONT face="Courier New" size=2></FONT> </DIV>
<DIV><FONT face="Courier New" size=2>Run: interactions-window:</FONT></DIV>
<DIV><FONT face="Courier New" size=2>Welcome to DrScheme, version
3.99.0.9-svn6jan2008 [3m].<BR>Language: Textual (MzScheme, includes
R5RS)</FONT></DIV>
<DIV><FONT face="Courier New" size=2>(p q)<BR>(p q)<BR>lazy.ss:12:3: a: bad
syntax in: (a p q r)</FONT></DIV>
<DIV><FONT face="Courier New" size=2>> </FONT></DIV>
<DIV><FONT face="Courier New" size=2></FONT> </DIV>
<DIV><FONT face="Courier New" size=2>This used to work in all earlier versions
of MzScheme. Now many things have changed, I know. What change do I overlook? It
seems like in the calls to syntax lazy, the ellipses are taken for a
common identifier. Any help will be very much appreciated. I already tried
to parse the rules given to syntax macro, replacing every occurrence of
identifier '...' by a locally introduced ellipsis, but that did not
help.</FONT></DIV>
<DIV><FONT face="Courier New" size=2>Jos Koot</FONT></DIV></BODY></HTML>