From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Lynn Winebarger Newsgroups: gmane.lisp.guile.devel Subject: Re: comments on new-model.txt Date: Mon, 9 Sep 2002 19:30:20 -0500 Sender: guile-devel-admin@gnu.org Message-ID: <0209091930202H.19624@locke.free-expression.org> References: <02090420222526.19624@locke.free-expression.org> <0209081847342E.19624@locke.free-expression.org> <877khuydrn.fsf@zagadka.ping.de> NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit X-Trace: main.gmane.org 1031618118 19212 127.0.0.1 (10 Sep 2002 00:35:18 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Tue, 10 Sep 2002 00:35:18 +0000 (UTC) Cc: guile-devel@gnu.org 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 17oYzt-0004zj-00 for ; Tue, 10 Sep 2002 02:35:17 +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 17oYzt-0006HS-00; Mon, 09 Sep 2002 20:35:17 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10) id 17oYzM-0006D2-00 for guile-devel@gnu.org; Mon, 09 Sep 2002 20:34:44 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10) id 17oYzK-0006Bd-00 for guile-devel@gnu.org; Mon, 09 Sep 2002 20:34:43 -0400 Original-Received: from plounts.uits.indiana.edu ([129.79.1.73]) by monty-python.gnu.org with esmtp (Exim 4.10) id 17oYzJ-0006BY-00 for guile-devel@gnu.org; Mon, 09 Sep 2002 20:34:41 -0400 Original-Received: from stjoseph.uits.indiana.edu (stjoseph.uits.indiana.edu [129.79.1.78]) by plounts.uits.indiana.edu (8.12.1/8.12.1/IUPO) with ESMTP id g8A0Yb7n008711; Mon, 9 Sep 2002 19:34:37 -0500 (EST) Original-Received: from locke.free-expression.org (dial-118-42.dial.indiana.edu [156.56.118.42]) by stjoseph.uits.indiana.edu (8.12.1/8.12.1/IUPO) with SMTP id g8A0YYRL019647; Mon, 9 Sep 2002 19:34:35 -0500 (EST) Original-To: Marius Vollmer X-Mailer: KMail [version 1.2] In-Reply-To: <877khuydrn.fsf@zagadka.ping.de> 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:1322 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.devel:1322 On Monday 09 September 2002 17:55, Marius Vollmer wrote: > Lynn Winebarger writes: > > > So, we have two SCM types, ilocs and variables (actually > > variable bindings, but we can leave that for later). ilocs always > > look up their values in the data environment of their closure, and > > variables are just pointers to a storage location. An extloc would > > be like an iloc (that is, a frame offset and distance in a frame), > > but would be stored in a cell where the second word pointed to the > > data environment to look it up in (the first word would contain the > > frame offset and distance). > > What use would be an extloc? Do you want to export lexical variables? Yes > Or would they be useful for hygienic macro expansion? Not exactly, but the process of writing my own version of syntax-case has made me think of variables in this way. > Can you give > example code that illustrates their use? Ok, I'll make up some incredibly bad notation (exporting-lambda () (define-exportable foo 'whatever) (define-exportable-syntax (lambda (x) (syntax-case x () ((_ f ...) (syntax 'xyzzy))))) ....) If we have extlocs, this can be just a plain lambda that happens to let import take references to some of its variables. Then we can use the keyword "module" instead. > > Likewise an extvarref would contain both the pointer to the binding > > and some way of identifying what top-level environment it's from. > > If we need to, we could find the originating module for a imported > variable also from the module that the current code is executed in. > This would be slower, but we would not need the extra pointer in > extvarrefs or variables. Part of the disagreement is that I don't think we should "evaluate in" modules. Partly this is a terminology issue: I think "module" should be reserved for separately compilable units of code that won't be invisibly dependent on whatever code happens to be currently loaded ("invisibly" is because imports are clearly visible to the module-using programmer, so are not prohibited). We should have some other terminology to describe other types of namespaces. Being able to import/export variables is just one knob on a namespace/environment/whatever. And then there's Dirk's view of modules as parameterizable to get a handle on too. > > This would be a convenient way to represent imported variables. The > > only concrete reason I can offer for including a pointer (of some > > form) to the top level environment of an external variable (actually > > any top-level variable) is for ones that aren't bound at the time of > > parsing (recalling that correct macro expansion can't be lazy in the > > presence of side-effects, as some of the syntax-case examples I've > > been posting should demonstrate). > > What would you do with that pointer? I'm thinking about it. Lynn _______________________________________________ Guile-devel mailing list Guile-devel@gnu.org http://mail.gnu.org/mailman/listinfo/guile-devel