From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) Newsgroups: gmane.lisp.guile.bugs Subject: bug#11988: eval-case redefinition? Date: Sat, 06 Oct 2012 23:24:19 +0200 Message-ID: <87r4pb5m64.fsf@gnu.org> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1349558688 20355 80.91.229.3 (6 Oct 2012 21:24:48 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 6 Oct 2012 21:24:48 +0000 (UTC) Cc: 11988@debbugs.gnu.org To: Daniel Llorens Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Sat Oct 06 23:24:54 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 1TKbrh-0003O1-22 for guile-bugs@m.gmane.org; Sat, 06 Oct 2012 23:24:53 +0200 Original-Received: from localhost ([::1]:45956 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TKbra-0006gG-UO for guile-bugs@m.gmane.org; Sat, 06 Oct 2012 17:24:46 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:35219) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TKbrY-0006eZ-SY for bug-guile@gnu.org; Sat, 06 Oct 2012 17:24:45 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TKbrX-0005cH-Pi for bug-guile@gnu.org; Sat, 06 Oct 2012 17:24:44 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:48408) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TKbrX-0005cD-MO for bug-guile@gnu.org; Sat, 06 Oct 2012 17:24:43 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1TKbrp-0007kw-Kt for bug-guile@gnu.org; Sat, 06 Oct 2012 17:25:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-guile@gnu.org Resent-Date: Sat, 06 Oct 2012 21:25:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 11988 X-GNU-PR-Package: guile X-GNU-PR-Keywords: Original-Received: via spool by 11988-submit@debbugs.gnu.org id=B11988.134955868529787 (code B ref 11988); Sat, 06 Oct 2012 21:25:01 +0000 Original-Received: (at 11988) by debbugs.gnu.org; 6 Oct 2012 21:24:45 +0000 Original-Received: from localhost ([127.0.0.1]:58659 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TKbrY-0007kN-RR for submit@debbugs.gnu.org; Sat, 06 Oct 2012 17:24:45 -0400 Original-Received: from xanadu.aquilenet.fr ([88.191.123.111]:43687) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TKbrV-0007kF-Ve for 11988@debbugs.gnu.org; Sat, 06 Oct 2012 17:24:42 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by xanadu.aquilenet.fr (Postfix) with ESMTP id 564B32873; Sat, 6 Oct 2012 23:24:20 +0200 (CEST) Original-Received: from xanadu.aquilenet.fr ([127.0.0.1]) by localhost (xanadu.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id HFnm9tPl5bzt; Sat, 6 Oct 2012 23:24:20 +0200 (CEST) Original-Received: from pluto (reverse-83.fdn.fr [80.67.176.83]) by xanadu.aquilenet.fr (Postfix) with ESMTPSA id C9C051361; Sat, 6 Oct 2012 23:24:19 +0200 (CEST) In-Reply-To: (Daniel Llorens's message of "Thu, 19 Jul 2012 15:22:44 +0200") User-Agent: Gnus/5.130005 (Ma Gnus v0.5) Emacs/24.2 (gnu/linux) 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:6542 Archived-At: Hi, Sorry for the delay. Daniel Llorens skribis: > I was cleaning up an old script which goes like this: > > (define (eval-case ...) ... val) > > (define var (eval-case ...)) > > This worked from the REPL, but when loading the file with (load > "script"), var was always #. It turns out that (my) > eval-case is never executed in this case. It turns out that =E2=80=98eval-case=E2=80=99 is a macro, and it gets macro= -expanded in the RHS of =E2=80=98define var=E2=80=99 above. This is the same situation as: --8<---------------cut here---------------start------------->8--- (define-syntax-rule (foo x) (- x)) (define (foo x) x) (pk 'foo (foo 42)) ; prints -42 --8<---------------cut here---------------end--------------->8--- =E2=80=9CExpansion process=E2=80=9D in R6RS seems to suggest that this is a= bug: For the right-hand side of the definition of a variable, ex- pansion is deferred until after all of the definitions have been seen. Consequently, each keyword and variable refer- ence within the right-hand side resolves to the local bind- ing, if any. Hmmm... Thoughts? Ludo=E2=80=99.