From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Jon Wilson Newsgroups: gmane.lisp.guile.user Subject: Re: Me no understand scoping Date: Wed, 30 Jul 2008 10:03:21 -0400 Message-ID: <489074A9.1080508@wilsonjc.us> References: <87r69ccaus.fsf@unknownlamer.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7BIT X-Trace: ger.gmane.org 1217426715 20244 80.91.229.12 (30 Jul 2008 14:05:15 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 30 Jul 2008 14:05:15 +0000 (UTC) To: guile-user@gnu.org Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Wed Jul 30 16:06:02 2008 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1KOCIA-0000GL-AO for guile-user@m.gmane.org; Wed, 30 Jul 2008 16:04:38 +0200 Original-Received: from localhost ([127.0.0.1]:46978 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KOCHG-0005Y3-5f for guile-user@m.gmane.org; Wed, 30 Jul 2008 10:03:42 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KOCH3-0005Tx-Bb for guile-user@gnu.org; Wed, 30 Jul 2008 10:03:29 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KOCH0-0005SD-5h for guile-user@gnu.org; Wed, 30 Jul 2008 10:03:28 -0400 Original-Received: from [199.232.76.173] (port=60805 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KOCGz-0005S2-3y for guile-user@gnu.org; Wed, 30 Jul 2008 10:03:25 -0400 Original-Received: from mailgw1.fnal.gov ([131.225.111.11]:41221) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KOCGy-0003V9-G4 for guile-user@gnu.org; Wed, 30 Jul 2008 10:03:24 -0400 Original-Received: from mailav2.fnal.gov (mailav2.fnal.gov [131.225.111.20]) by mailgw1.fnal.gov (iPlanet Messaging Server 5.2 HotFix 2.06 (built Mar 28 2005)) with SMTP id <0K4T00430O1E0Z@mailgw1.fnal.gov> for guile-user@gnu.org; Wed, 30 Jul 2008 09:03:22 -0500 (CDT) Original-Received: from mailgw2.fnal.gov ([131.225.111.12]) by mailav2.fnal.gov (SAVSMTP 3.1.7.47) with SMTP id M2008073009032221070 for ; Wed, 30 Jul 2008 09:03:22 -0500 Original-Received: from conversion-daemon.mailgw2.fnal.gov by mailgw2.fnal.gov (iPlanet Messaging Server 5.2 HotFix 2.06 (built Mar 28 2005)) id <0K4T00M01O3SCJ@mailgw2.fnal.gov> (original mail from jsw@wilsonjc.us) for guile-user@gnu.org; Wed, 30 Jul 2008 09:03:22 -0500 (CDT) Original-Received: from wilsonjc.us (cpe-75-187-46-126.columbus.res.rr.com [75.187.46.126]) by mailgw2.fnal.gov (iPlanet Messaging Server 5.2 HotFix 2.06 (built Mar 28 2005)) with ESMTPSA id <0K4T00292ODLRG@mailgw2.fnal.gov> for guile-user@gnu.org; Wed, 30 Jul 2008 09:03:22 -0500 (CDT) In-reply-to: User-Agent: Thunderbird 2.0.0.16 (X11/20080724) X-detected-kernel: by monty-python.gnu.org: Solaris 9 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.user:6703 Archived-At: Maciek Godek wrote: > as for eval, it will always be there (in RnRS) EVAL has not been in every report. R4RS did not specify EVAL, nor did R3RS, RRRS, RRS. > besides I don't imagine not messing with lexical > environments :) The bad thing is that scopes aren't > explicitly definable and the report doesn't say > much about their properties. I don't know how > about practical performance, but I'd find it best > if they were implemented as (implicit) hash tables > that could be bound to variables and passed as > arguments. I think that they could perform > equally good as fixed arrays for memoized > procedures. The view of the scheme community as a whole is that first class lexical environments are irreconcilable with the need to compile (optimize) code. In many cases, once you have done some variety of compilation, a lot of the lexical environments you think you ought to have will have been optimized away; conversely, preserving these environments will prevent entire classes of compilation. I am of the suspicion that in most cases, the environment would never be reified, the compiler could prove this, and optimization could proceed as desired. However, I would still agree with Clinton that you should avoid messing with environments, first class or otherwise, whenever possible. When you must, you should quarantine it: use it in a very limited part of your code, where you wrap it in a more mundane abstraction, then use that abstraction elsewhere. CALL/CC should be treated the same way usually. Broadening the topic a bit, it seems that first class envs and macros (and maybe not macros!) are all that would be needed to define a module system in scheme, rather than building it into the interpreter. Then the module system could be put in a file which any r5rs+envs (or whatever standard you like) scheme could LOAD (most likely implicitly at startup) without modification to the interpreter itself. It might even be the case that DEFMACROs and reified environments would be sufficient to make low-level hygienic macros a library too (but I'm no macrologist, for sure). You would still have to deal with the compilation issues, but as I said, my gut feeling is that these are solvable. Regards, Jon