Identifier renamed by R7RS syntax-rules won't be resolved properly

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

Issue from here:

Following script should print 3 but prints 2

(import (scheme base)
        (scheme write))

(define-syntax bar
  (syntax-rules ()
    ((_ m body)
     (let ((m 1))

(define-syntax foo
  (syntax-rules ()
    ((_ m body)
     (let ((n 2))
       (let-syntax ((%body
                     (syntax-rules ()
                       ((_) body))))
         (bar m %body))))))

(let ((n 3))
  (display (foo n (display n))))

Comments (1)

  1. Log in to comment