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: http://saito.hatenablog.jp/entry/2014/03/24/070839

Following script should print 3 but prints 2

(import (scheme base)
        (scheme write))

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

(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