From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Mikael Djurfeldt Newsgroups: gmane.lisp.guile.bugs Subject: Re: Strange undefined binding bug coupled to module system Date: 10 Nov 2004 09:51:21 +0100 Message-ID: References: Reply-To: djurfeldt@nada.kth.se NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1100076934 14677 80.91.229.6 (10 Nov 2004 08:55:34 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 10 Nov 2004 08:55:34 +0000 (UTC) Cc: bug-guile@gnu.org, djurfeldt@nada.kth.se Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Wed Nov 10 09:55:21 2004 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1CRoG9-0002fm-00 for ; Wed, 10 Nov 2004 09:55:21 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CRoOa-0001PK-N8 for guile-bugs@m.gmane.org; Wed, 10 Nov 2004 04:04:04 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1CRoLa-0000CL-A6 for bug-guile@gnu.org; Wed, 10 Nov 2004 04:00:58 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1CRoLZ-0000Bc-Ao for bug-guile@gnu.org; Wed, 10 Nov 2004 04:00:57 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CRoLY-00009T-8V for bug-guile@gnu.org; Wed, 10 Nov 2004 04:00:56 -0500 Original-Received: from [213.212.20.77] (helo=kvast.blakulla.net) by monty-python.gnu.org with esmtp (Exim 4.34) id 1CRoCV-0004w7-Ol for bug-guile@gnu.org; Wed, 10 Nov 2004 03:51:36 -0500 Original-Received: from mamaliga.blakulla.net ([213.212.21.241] helo=witch) by kvast.blakulla.net with esmtp (Exim 3.36 #1 (Debian)) id 1CRoCI-0001pt-00; Wed, 10 Nov 2004 09:51:22 +0100 Original-Received: from mdj by witch with local (Exim 4.34) id 1CRoCH-0001XQ-TU; Wed, 10 Nov 2004 09:51:21 +0100 Original-To: Marius Vollmer In-Reply-To: Original-Lines: 30 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 X-BeenThere: bug-guile@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Errors-To: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.lisp.guile.bugs:2022 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.bugs:2022 Marius Vollmer writes: > Mikael Djurfeldt writes: > > > 2004-04-22 Dirk Herrmann > > > > (scm_m_define): Change order to first create binding and > > evaluating the expression afterwards. > > > > While this change works in the R5RS situation without a module system, > > the presence of a module system, with the difference between imported > > and local bindings, introduces complications. > > What would happen if you just revert that change? The change is a bugfix for another bug, so reverting it would swap one bug for another. The bug which Dirk fixed is that Guile previously created the binding after the expression of the define had been evaluated, while R5RS section 5.2.1 specifies that a define is like a set! to an existing binding. Thus, R5RS allows an expression like: (define foo (begin (set! foo 3) (* 5 foo))) Chez Scheme accepts the above expression and Guile does it after Dirk's change. If we reverted the change, Guile would complain that foo is an unbound variable, which is inconsistent with R5RS. M _______________________________________________ Bug-guile mailing list Bug-guile@gnu.org http://lists.gnu.org/mailman/listinfo/bug-guile