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

Re: hygiene when using multiple instances of a macro..?

This page is part of the web mail archives of SRFI 72 from before July 7th, 2015. The new archives for SRFI 72 contain all messages, not just those from before July 7th, 2015.

I'll try to write a macro definition to show the situation I was talking

(define-syntax (can-we-stand-duplicates a-macro)
    (if ,a-macro
      (let ((x 3)) (,a-macro #f))

(define-syntax (test)
  (quasisyntax (can-we-stand-duplicates can-we-stand-duplicates)))


... if it works wrong, it expands to (something that evaluates to) 3.
If it works right, it expands to something that has an unbound

The reason I suspected the wrong behavior is that in some rewrite-based
systems, the fact the both x's are created in the same context (here, in
the same quasisyntax) suffices to make them identical, even though they
should not be identical across different invocations of the macro.


personal contact: atehwa@xxxxxx, +35841 5323835, +3589 85619369
work contact: panu.kalliokoski@xxxxxxxxxxx, +35850 3678003
kotisivu (henkkoht):	http://www.iki.fi/atehwa/
homepage (technical):	http://sange.fi/~atehwa/