chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Chicken-users] About define-syntax and expansion environment


From: Xin Wang
Subject: [Chicken-users] About define-syntax and expansion environment
Date: Fri, 14 Jun 2013 22:30:28 +0800

Hi,

I encountered a problem that previously defined macro can not be used inside other macro defination.

It seems that newly defined syntax does not available in macro expansion environment, is it intended?


Here are some simplified code:

---8<---
(define-syntax fn
  (syntax-rules ()
    ((fn exp ...) (lambda exp ...))))

(define-syntax macro
  (er-macro-transformer
   (lambda (form rename compare)
     (let ((f (fn (x) x)))
       `(list ,@(map f form))))))
--->8---

In 4.8.0.3, repl complains with:

---8<---
Note: the following toplevel variables are referenced but unbound:

  fn
  x
  x
--->8---

Regards,
Xin Wang

reply via email to

[Prev in Thread] Current Thread [Next in Thread]