[R6RS] Fresh syntax

dyb at cs.indiana.edu dyb at cs.indiana.edu
Thu May 11 13:33:59 EDT 2006

> >  (define-syntax main
> >    (lambda (stx)
> >      (let ((make-swap
> >             (lambda (x y)
> >               (with-syntax ((x x) (y y))
> >                 (fresh-syntax
> >                   (let ((t x))
> >                     (set! x y)
> >                     (set! y t)))))))
> >        (syntax-case stx ()
> >          ((_)
> >           (with-syntax ((swap (make-swap (syntax s) (syntax t))))
> >             (syntax
> >               (let ((s 1) (t 2))
> >                 swap
> >                 (list s t)))))))))

> I wasn't able to write a correct equivalent of the above example using 
> make-syntax-introducer.  If fresh-syntax works as above, then I think 
> I'm satisfied (for now!), except that FRESH-SYNTAX isn't yet part of the 
> proposal.

I've just committed a new version of the reference implementation that
supports fresh-syntax, and the example above works as expected.  I have
not moved fresh-syntax from the issues section into the main body of the
SRFI document but will do so if two or more of you speaks up for it. 
(I'll count Anton as one already, so one more is enough.) For my part, I
don't see a compelling need for this feature but nor do I object to
including it.


More information about the R6RS mailing list