From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Israelsson Tampe Newsgroups: gmane.lisp.guile.bugs Subject: bug#10991: syntax-local-binding does not play well with fluid-let-syntax Date: Sun, 11 Mar 2012 12:47:22 +0100 Message-ID: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary=00235451e82850505404baf6302d X-Trace: dough.gmane.org 1331466506 3848 80.91.229.3 (11 Mar 2012 11:48:26 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 11 Mar 2012 11:48:26 +0000 (UTC) To: 10991@debbugs.gnu.org Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Sun Mar 11 12:48:26 2012 Return-path: Envelope-to: guile-bugs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1S6hGC-0002vo-3u for guile-bugs@m.gmane.org; Sun, 11 Mar 2012 12:48:24 +0100 Original-Received: from localhost ([::1]:40288 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S6hGB-0006t4-BI for guile-bugs@m.gmane.org; Sun, 11 Mar 2012 07:48:23 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:34868) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S6hG8-0006sn-CU for bug-guile@gnu.org; Sun, 11 Mar 2012 07:48:21 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S6hG6-0002g3-PV for bug-guile@gnu.org; Sun, 11 Mar 2012 07:48:19 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:37829) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S6hG6-0002fx-K0 for bug-guile@gnu.org; Sun, 11 Mar 2012 07:48:18 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1S6his-0003Qj-9i for bug-guile@gnu.org; Sun, 11 Mar 2012 08:18:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Israelsson Tampe Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-guile@gnu.org Resent-Date: Sun, 11 Mar 2012 12:18:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 10991 X-GNU-PR-Package: guile X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-guile@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.133146823713120 (code B ref -1); Sun, 11 Mar 2012 12:18:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 11 Mar 2012 12:17:17 +0000 Original-Received: from localhost ([127.0.0.1]:44661 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S6hi8-0003PX-O6 for submit@debbugs.gnu.org; Sun, 11 Mar 2012 08:17:17 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:48491) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S6hi6-0003PO-Au for submit@debbugs.gnu.org; Sun, 11 Mar 2012 08:17:16 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S6hFI-0002cN-9E for submit@debbugs.gnu.org; Sun, 11 Mar 2012 07:47:29 -0400 Original-Received: from lists.gnu.org ([208.118.235.17]:35837) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S6hFI-0002cJ-3K for submit@debbugs.gnu.org; Sun, 11 Mar 2012 07:47:28 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:34699) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S6hFG-0006ry-Gi for bug-guile@gnu.org; Sun, 11 Mar 2012 07:47:27 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S6hFE-0002c3-JQ for bug-guile@gnu.org; Sun, 11 Mar 2012 07:47:25 -0400 Original-Received: from mail-ey0-f169.google.com ([209.85.215.169]:41551) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S6hFE-0002bf-AX for bug-guile@gnu.org; Sun, 11 Mar 2012 07:47:24 -0400 Original-Received: by eaal1 with SMTP id l1so796470eaa.0 for ; Sun, 11 Mar 2012 04:47:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=1W1R/2TwFY5D3JLnOzMjFWwMt9gp4/K6EF5SI7lWziU=; b=ohSMaq7E/ccE1LyFSV1lDIV9Yfbsyeg0l2XaIMeHfmqSYairLj3ywjUjv3Mq8tEokn 0l7dl4ajD2EybWrc1r86zZuKmnEpgstT1gKHOqG7Qk6t813onmXY+e8+S2wFDXtIRNRP +7w9rkwmbugBqXA/YnqoBDSMBGOmBy9Sf7lRBYnXpffw4otdwTTNbnllQlDbLRLXvgFr grHEhlNt9M+nQ8mSzuS5LV/Fw+EQ59SqU9ZMNzCQIRpU5tzkipz2P9vd8jaVMJ0XGa2R fWozsjBGLlKAk3SdYyi6yACwD3sNT1aTwc/ERbsMwtSqvXW7AkH5bWcfqZ2RtL45q7+J +HdA== Original-Received: by 10.14.32.139 with SMTP id o11mr1405792eea.10.1331466442133; Sun, 11 Mar 2012 04:47:22 -0700 (PDT) Original-Received: by 10.213.13.206 with HTTP; Sun, 11 Mar 2012 04:47:22 -0700 (PDT) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 140.186.70.43 X-BeenThere: bug-guile@gnu.org List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Original-Sender: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.bugs:6258 Archived-At: --00235451e82850505404baf6302d Content-Type: multipart/alternative; boundary=00235451e82850504b04baf6302b --00235451e82850504b04baf6302b Content-Type: text/plain; charset=ISO-8859-1 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) --00235451e82850504b04baf6302b Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable loading local-stx shows that setting a macro via fluid-let-syntax does not<= br>play well with syntax-local-binding who just sees the outside main
de= finition and not the newly introduced binding!
=A0-------------------
(use-modules (system syntax))
(use-modules (srfi srfi-11))

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

(define-syntax f %f)

(define-= syntax info
=A0 (lambda (x)
=A0=A0=A0 (syntax-case x ()
=A0=A0=A0=A0=A0 ((_ f) =A0=A0=A0=A0=A0=A0 (let-values (((key ret) (syntax-local-binding #'f)= ))
=A0=A0=A0=A0=A0=A0=A0=A0 (pk key)
=A0=A0=A0=A0=A0=A0=A0=A0 ret))))= )
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0
;;This shows that f reboun= ds to yield #t but the info returns %f
(eq?
=A0(fluid-let-syntax ((f (lambda x #'#t)))
=A0=A0 (pk (f 1))=
=A0=A0 (info f))
=A0%f)
--00235451e82850504b04baf6302b-- --00235451e82850505404baf6302d Content-Type: text/x-scheme; charset=US-ASCII; name="local-stx.scm" Content-Disposition: attachment; filename="local-stx.scm" Content-Transfer-Encoding: base64 X-Attachment-Id: f_gzo0rhrx0 KHVzZS1tb2R1bGVzIChzeXN0ZW0gc3ludGF4KSkKKHVzZS1tb2R1bGVzIChzcmZpIHNyZmktMTEp KQoKKGV2YWwtd2hlbiAoY29tcGlsZSBsb2FkIGV2YWwpCiAgKGRlZmluZSAoJWYgeCkgKGVycm9y ICJ0aGlzIG1hY3JvIHNob3VsZCBuZXZlciBiZSBjYWxsZWQiKSkpCgooZGVmaW5lLXN5bnRheCBm ICVmKQoKKGRlZmluZS1zeW50YXggaW5mbwogIChsYW1iZGEgKHgpCiAgICAoc3ludGF4LWNhc2Ug eCAoKQogICAgICAoKF8gZikgCiAgICAgICAobGV0LXZhbHVlcyAoKChrZXkgcmV0KSAoc3ludGF4 LWxvY2FsLWJpbmRpbmcgIydmKSkpCiAgICAgICAgIChwayBrZXkpCiAgICAgICAgIHJldCkpKSkp CiAgICAgICAgICAgICAgCjs7VGhpcyBzaG93cyB0aGF0IGYgcmVib3VuZHMgdG8geWllbGQgI3Qg YnV0IHRoZSBpbmZvIHJldHVybnMgJWYKKGVxPwogKGZsdWlkLWxldC1zeW50YXggKChmIChsYW1i ZGEgeCAjJyN0KSkpCiAgIChwayAoZiAxKSkKICAgKGluZm8gZikpCiAlZikKICAgICAgICAgICAg ICAgICAgCgo= --00235451e82850505404baf6302d--