From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Dirk Herrmann Newsgroups: gmane.lisp.guile.devel Subject: Re: illegal uses of define in guile Date: Sat, 19 Oct 2002 17:22:03 +0200 (CEST) Sender: guile-devel-admin@gnu.org Message-ID: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Trace: main.gmane.org 1035041050 30820 80.91.224.249 (19 Oct 2002 15:24:10 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sat, 19 Oct 2002 15:24:10 +0000 (UTC) Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 182vSS-00080s-00 for ; Sat, 19 Oct 2002 17:24:08 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10) id 182vSU-0006ae-00; Sat, 19 Oct 2002 11:24:10 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10) id 182vQX-0006E7-00 for guile-devel@gnu.org; Sat, 19 Oct 2002 11:22:09 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10) id 182vQU-0006Ct-00 for guile-devel@gnu.org; Sat, 19 Oct 2002 11:22:08 -0400 Original-Received: from sallust.ida.ing.tu-bs.de ([134.169.132.52]) by monty-python.gnu.org with esmtp (Exim 4.10) id 182vQT-0006CZ-00 for guile-devel@gnu.org; Sat, 19 Oct 2002 11:22:05 -0400 Original-Received: from localhost (dirk@localhost) by sallust.ida.ing.tu-bs.de (8.9.3+Sun/8.9.1) with ESMTP id RAA10712 for ; Sat, 19 Oct 2002 17:22:04 +0200 (CEST) Original-To: guile-devel@gnu.org Errors-To: guile-devel-admin@gnu.org X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Developers list for Guile, the GNU extensibility library List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.lisp.guile.devel:1571 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.devel:1571 Hi, as far as I understand it, we want to further allow uses of define as in the following situation: > (if (not (defined? '%load-verbosely)) > (define %load-verbosely #f)) You have convinced me, since I now have understood the following: We must be able to handle non-bound identifiers during compilation anyway. Such identifiers may legally become bound later, for example because of some use of 'eval or 'load. For example, the compiler has to be able to emit code for (define (foo) bar) even if bar was not yet defined at that time. Only when foo gets evaluated, bar has to be defined. Allowing > (if (not (defined? '%load-verbosely)) > (define %load-verbosely #f)) relies on this fact. However, it even goes somewhat further: It requires that the executor must be able to handle definitions. As said above, I agree that we can do this. However, we should make one thing sure: Once a binding has been referenced, the binding itself should never change. Otherwise, memoizing lookups of identifiers in a top-level environment could never be done (or would require to use some logic to undo memoization whenever a binding changes). IMO it is better to define the system such that re-binding of identifiers is not allowed. Summarized: * The compiler must be able to emit code that allows references to identifiers to be looked up at use time (that is, in the executor). * The executor must be able to handle definitions. * Once a binding has been referenced, the binding should not change. Best regards, Dirk Herrmann _______________________________________________ Guile-devel mailing list Guile-devel@gnu.org http://mail.gnu.org/mailman/listinfo/guile-devel