Subject: bug#10991: syntax-local-binding does not play well with fluid-let-syntax

From: Stefan Israelsson Tampe <[email-masked]>
Date: Sun, 11 Mar 2012 12:47:22 +0100

loading local-stx shows that setting a macro via fluid-let-syntax does not
play well with syntax-local-binding who just sees the outside main
definition and not the newly introduced binding!
 -------------------

(use-modules (system syntax))
(use-modules (srfi srfi-11))

(eval-when (compile load eval)
  (define (%f x) (error "this macro should never be called")))

(define-syntax f %f)

(define-syntax info
  (lambda (x)
    (syntax-case x ()
      ((_ f)
       (let-values (((key ret) (syntax-local-binding #'f)))
         (pk key)
         ret)))))

;;This shows that f rebounds to yield #t but the info returns %f
(eq?
 (fluid-let-syntax ((f (lambda x #'#t)))
   (pk (f 1))
   (info f))
 %f)