From: Stefan Israelsson Tampe <stefan.itampe@gmail.com>
To: 10991@debbugs.gnu.org
Subject: bug#10991: syntax-local-binding does not play well with fluid-let-syntax
Date: Sun, 11 Mar 2012 12:47:22 +0100 [thread overview]
Message-ID: <CAGua6m3rZ8Gk44nd1iTwKM3BcQeO4YtTBQOVSpexkXOzyM_RHQ@mail.gmail.com> (raw)
[-- 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)
next reply other threads:[~2012-03-11 11:47 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-11 11:47 Stefan Israelsson Tampe [this message]
2012-07-06 9:25 ` bug#10991: syntax-local-binding does not play well with fluid-let-syntax 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/guile/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAGua6m3rZ8Gk44nd1iTwKM3BcQeO4YtTBQOVSpexkXOzyM_RHQ@mail.gmail.com \
--to=stefan.itampe@gmail.com \
--cc=10991@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).