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

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

On Sun, May 31, 2009 at 11:38 PM, Carl Eastlund<carl.eastlund at gmail.com> wrote:
> You can use define-values-for-syntax:
> (define-values-for-syntax [is-even? is-odd?]
>  (values
>    (lambda (x) (if (zero? x) #t (is-odd? (sub1 x))))
>    (lambda (x) (if (zero? x) #f (is-even? (sub1 x))))))

Ah, thanks, Carl. I usually try to avoid this form since it separates
the name from the lambda by such a long distance, but this seems to be
the quick fix for my current troubles.


Posted on the users mailing list.