This is the mail archive of the kawa@sources.redhat.com mailing list for the Kawa project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]