GNU bug report logs - #10991
syntax-local-binding does not play well with fluid-let-syntax

Previous Next

Package: guile;

Reported by: Stefan Israelsson Tampe <stefan.itampe <at> gmail.com>

Date: Sun, 11 Mar 2012 12:18:01 UTC

Severity: normal

Done: Andy Wingo <wingo <at> pobox.com>

Bug is archived. No further changes may be made.

Full log


Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Stefan Israelsson Tampe <stefan.itampe <at> gmail.com>
To: bug-guile <at> gnu.org
Subject: syntax-local-binding does not play well with fluid-let-syntax
Date: Sun, 11 Mar 2012 12:47:22 +0100
[Message part 1 (text/plain, inline)]
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)
[Message part 2 (text/html, inline)]
[local-stx.scm (text/x-scheme, attachment)]

This bug report was last modified 12 years and 70 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.