From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Mark H Weaver Newsgroups: gmane.lisp.guile.devel Subject: Re: [PATCH] local-eval, local-compile, and the-environment (v3) Date: Sun, 15 Jan 2012 12:14:52 -0500 Message-ID: <871ur06g6r.fsf@netris.org> References: <8762gd5vkl.fsf@netris.org> <87obu52cvx.fsf@fencepost.gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1326647739 25473 80.91.229.12 (15 Jan 2012 17:15:39 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 15 Jan 2012 17:15:39 +0000 (UTC) Cc: guile-devel@gnu.org To: David Kastrup Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Sun Jan 15 18:15:32 2012 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RmTg3-0006ah-Vy for guile-devel@m.gmane.org; Sun, 15 Jan 2012 18:15:32 +0100 Original-Received: from localhost ([::1]:40166 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RmTg3-0007KF-87 for guile-devel@m.gmane.org; Sun, 15 Jan 2012 12:15:31 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:47476) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RmTg0-0007KA-Vl for guile-devel@gnu.org; Sun, 15 Jan 2012 12:15:29 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RmTfz-0004Cq-LO for guile-devel@gnu.org; Sun, 15 Jan 2012 12:15:28 -0500 Original-Received: from world.peace.net ([96.39.62.75]:40008) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RmTfz-0004Cl-GG; Sun, 15 Jan 2012 12:15:27 -0500 Original-Received: from c-98-216-245-176.hsd1.ma.comcast.net ([98.216.245.176] helo=yeeloong) by world.peace.net with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.69) (envelope-from ) id 1RmTfu-0005eQ-9c; Sun, 15 Jan 2012 12:15:22 -0500 In-Reply-To: <87obu52cvx.fsf@fencepost.gnu.org> (David Kastrup's message of "Sun, 15 Jan 2012 16:39:46 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.92 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 96.39.62.75 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:13517 Archived-At: David Kastrup writes: > I am not altogether comfortable with pushing a "temporary fix" for the > sake of LilyPond when we'll get another behavioral change with the next > version. But there would _not_ be a behavioral change in the next version. It would only be a change in the internal implementation. > As far as I understand, this implementation could be pulled into a > separate file and used for bridging the 2.0.0-2.0.3 gap. Unfortunately, any implementation of `local-eval' requires changes to psyntax.scm, which is not something that you could reasonably do as an external package. > I am not sure that the reasons for not permitting definition context in > local-eval are not of somewhat more theoretical than practical nature, There's at least one practical reason not to allow it, namely that it is _impossible_ to implement. Consider this: (let ((x 1)) (define (get-x) x) (the-environment)) If we allow (the-environment) to add definitions to the implicit `letrec', then (get-x) cannot know which binding of `x' to use. In fact, it cannot lookup _any_ bindings, because absolutely any identifier (even syntactic keywords) could be redefined within this implicit `letrec'. This means that it's impossible to compile or evaluate anything within the body of the outer `let', which means it's not even possible to evaluate (the-environment) itself. So there's no way to run the code above if we allow (the-environment) to add definitions. Mark