This is the mail archive of the
kawa@sources.redhat.com
mailing list for the Kawa project.
Calling define within define-syntax
- From: Chris Dean <ctdean at sokitomi dot com>
- To: Kawa List <kawa at sources dot redhat dot com>
- Date: Thu, 16 Sep 2004 01:21:19 -0700
- Subject: Calling define within define-syntax
Didn't this used to work?
(define-syntax define*
(syntax-rules ()
((define* (name arg ...) body ...)
(define (name arg ... )
(format #t "--- start ~S~%" name)
(let ((res (begin body ...)))
(format #t "--- end ~S~%" name)
res)))))
(define* (fact n)
(if (< n 2)
1
(* n (fact (- n 1)))))
Now, when I compile I get:
Foo2.scm:19:1: define is only allowed in a <body>
where line 19 is where fact is defined.
Regards,
Chris Dean