[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
support for (... ...) ellipsis quoting? (Was: local syntax-rules)
From: |
Lars J. Aas |
Subject: |
support for (... ...) ellipsis quoting? (Was: local syntax-rules) |
Date: |
Tue, 7 Nov 2000 13:20:08 +0100 |
User-agent: |
Mutt/1.2.5i |
On Tue, Nov 07, 2000 at 12:23:28PM +0200, Ivan Toshkov wrote:
: Lars J. Aas writes:
: > On Mon, Nov 06, 2000 at 05:14:08PM +0100, Lars J. Aas wrote:
: > : (define-syntax argtypes
: > : (let-syntax ((argtype (syntax-rules ()
: > : ((argtype (name type)) type)
: > : ((argtype name) <top>))))
: > : (syntax-rules ()
: > : ((argtypes arg) (cons (argtype arg) '()))
: > : ((argtypes arg arg1 ...) (cons (argtype arg) (argtypes arg1
...))))))
: > :
: > : Should I use let-syntax in another way (e.g. *inside* the argtypes
syntax-rules)?
:
: If I think of something I'll let you know :) Meanwhile, why don't you try to
: post your question in comp.lang.scheme and see what they have to say about it?
: I guess most of the guile developers/users prefer lisp-style macros and that's
: why you don't get many answers here...
I did, and got this suggestion:
(define-syntax argtypes
(syntax-rules ()
((argtypes arg1 ...)
(letrec-syntax ((argtype (syntax-rules ()
((argtype (name type)) type)
((argtype name) <top>)))
(argtypes (syntax-rules ()
((argtypes arg)
(cons (argtype arg) '()))
((argtypes arg arg1 (... ...))
(cons (argtype arg)
(argtypes arg1 (... ...)))))))
(argtypes arg1 ...)))))
The (... ...) construct is a non-R5RS extension for quoting ellipsis, which
supposedly was supported by most R5RS scheme implementations, but it doesn't
seem to be supported in Guile because I get this error:
ERROR: missing ellipsis in syntax form (syntax (letrec-syntax ((argtype [...]
ABORT: (misc-error)
Can anyone confirm that the (... ...) convention is unsupported?
I'm going to try to rewrite it using the single-dot pattern notation instead
(which is R5RS) to see if I can get that to work...
Lars J