This is the mail archive of the
kawa@sources.redhat.com
mailing list for the Kawa project.
working nested let-syntax (macrolet in kawa/Scheme)?
- From: "Hoehle, Joerg-Cyril" <Joerg-Cyril dot Hoehle at t-systems dot com>
- To: kawa at sources dot redhat dot com
- Date: Mon, 13 Dec 2004 18:10:50 +0100
- Subject: working nested let-syntax (macrolet in kawa/Scheme)?
Hi,
I defined the following macro using R5RS idioms and fail to understand why I get an error.
(define-syntax collecting
(syntax-rules (collect)
((_ body ...)
(let ((x '()))
(let-syntax
((collect (syntax-rules ()
((collect e) (set! x (cons e x))))))
body ...)
(reverse x)))))
(collecting 1) -> <stdin>:170:2: variable in let binding is not a symbol
(let ((x '()))
(let-syntax ; this works
((collect (syntax-rules ()
((collect e) (set! x (cons e x))))))
(collect 1) 2) (reverse x))
What's wrong with the definition?
[The goal is to mimic a typical collecting idiom in Common Lisp].
Regards,
Jorg Hohle
Using Kawa-1.7.jar on Suse-Linux-9.x