Incorrect variable lookup converted by datum->syntax

Create issue
Issue #92 resolved
Takashi Kato repo owner created an issue

If an identifier is not bound the same level then it should not be the same. Following should raise an unbound error.

(define-syntax aif
  (lambda (x)
    (syntax-case x ()
      ((ng test then)
       #'(aif test then #f)) ;; template variable aif is not the same bound if (aif #t it)
      ((aif test then else)
       (with-syntax ((it (datum->syntax #'aif 'it)))
         #'(let ((it test))
             (if it then else)))))))
(aif #t it)

Comments (1)

  1. Takashi Kato reporter

    Changing er-rename not to lookup before renaming. Adding identifier identity slot to determine whether identifiers are the same bound or not. Adding different bound test case. Fixes #89 Fixes #92

    → <<cset 4f7dbb94ab8b>>

  2. Log in to comment