unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
* bug#10991: syntax-local-binding does not play well with fluid-let-syntax
@ 2012-03-11 11:47 Stefan Israelsson Tampe
  2012-07-06  9:25 ` Andy Wingo
  0 siblings, 1 reply; 7+ messages in thread
From: Stefan Israelsson Tampe @ 2012-03-11 11:47 UTC (permalink / raw)
  To: 10991


[-- Attachment #1.1: Type: text/plain, Size: 699 bytes --]

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)

[-- Attachment #1.2: Type: text/html, Size: 821 bytes --]

[-- Attachment #2: local-stx.scm --]
[-- Type: text/x-scheme, Size: 521 bytes --]

(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)
                  


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2013-03-13 10:44 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-11 11:47 bug#10991: syntax-local-binding does not play well with fluid-let-syntax Stefan Israelsson Tampe
2012-07-06  9:25 ` Andy Wingo
2012-07-06 19:03   ` Stefan Israelsson Tampe
2012-07-06 19:37     ` Andy Wingo
2012-07-06 19:46       ` Stefan Israelsson Tampe
2012-09-23 10:22         ` Stefan Israelsson Tampe
2013-03-13 10:44           ` Andy Wingo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).