[plt-scheme] define-for-syntax mutual recursion

From: Anthony Cowley (acowley at seas.upenn.edu)
Date: Sun May 31 23:27:56 EDT 2009

I believe this is a variation of a past question, but I don't think it
was completely answered...

Is there any way to have mutually recursive functions defined via
define-for-syntax?

When writing run-time code, I can write
(define (foo x) (bar x))
(define (bar x) (+ x 2))

and that's fine. But I can't write,
(define-for-syntax (foo x) (bar x))
(define-for-syntax (bar x) (+ x 2))

In this example, I could of course re-order the definitions, but if
they call each other then I seem to be out of luck. I would be happier
not having to move these guys into another module, but at the very
least I'd like to have a better understanding why such a construction
is disallowed.

Can someone shed some light on this for me?

Thanks,
Anthony


Posted on the users mailing list.