From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Kastrup Newsgroups: gmane.lisp.guile.devel Subject: Re: summary: lilypond, lambda, and local-eval Date: Fri, 16 Dec 2011 13:43:08 +0100 Organization: Organization?!? Message-ID: <87k45w3cwz.fsf@fencepost.gnu.org> References: <87r506uodd.fsf@pobox.com> <87pqfpj7e3.fsf@netris.org> <87liqcamrf.fsf@pobox.com> <871us4kdqy.fsf@netris.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1324039425 30995 80.91.229.12 (16 Dec 2011 12:43:45 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 16 Dec 2011 12:43:45 +0000 (UTC) To: guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Fri Dec 16 13:43:42 2011 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 1RbX8V-0003V8-Ff for guile-devel@m.gmane.org; Fri, 16 Dec 2011 13:43:39 +0100 Original-Received: from localhost ([::1]:48962 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RbX8V-0001Yb-4I for guile-devel@m.gmane.org; Fri, 16 Dec 2011 07:43:39 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:54026) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RbX8N-0001W5-K8 for guile-devel@gnu.org; Fri, 16 Dec 2011 07:43:37 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RbX8F-0005Qo-SS for guile-devel@gnu.org; Fri, 16 Dec 2011 07:43:31 -0500 Original-Received: from lo.gmane.org ([80.91.229.12]:37802) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RbX8F-0005Qb-JE for guile-devel@gnu.org; Fri, 16 Dec 2011 07:43:23 -0500 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1RbX8E-0003N8-0k for guile-devel@gnu.org; Fri, 16 Dec 2011 13:43:22 +0100 Original-Received: from p508edf03.dip.t-dialin.net ([80.142.223.3]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 16 Dec 2011 13:43:22 +0100 Original-Received: from dak by p508edf03.dip.t-dialin.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 16 Dec 2011 13:43:22 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 38 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: p508edf03.dip.t-dialin.net X-Face: 2FEFf>]>q>2iw=B6, xrUubRI>pR&Ml9=ao@P@i)L:\urd*t9M~y1^:+Y]'C0~{mAl`oQuAl \!3KEIp?*w`|bL5qr,H)LFO6Q=qx~iH4DN; i"; /yuIsqbLLCh/!U#X[S~(5eZ41to5f%E@'ELIi$t^ Vc\LWP@J5p^rst0+('>Er0=^1{]M9!p?&:\z]|;&=NP3AhB!B_bi^]Pfkw User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.92 (gnu/linux) Cancel-Lock: sha1:nqPE06y5FEHVHBd+N2tPmLzLzVM= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 80.91.229.12 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:13137 Archived-At: Hans Aberg writes: > On 16 Dec 2011, at 11:33, Mark H Weaver wrote: > >> Here's what I currently see: >> >> scheme@(guile-user)> (local-eval #'t (primitive-eval '(let ((t 42)) >> (or #f (the-environment))))) >> ERROR: In procedure memoize-variable-access!: >> ERROR: Unbound variable: t >> >> This is the correct behavior, no? > > This is what I get when I play around with the following variation of David's code in Guile 2.0.3: > (define (xxx) > (let* ((x 2)) > (set! x (+ x 3)) > (interaction-environment))) > > (eval '(begin (set! x (+ x 5)) x) (xxx)) > > My guess (correct?) is that one wants some variation of > (interaction-environment) that can cause x in the eval expression to > bind to the environment returned by (xxx). > > Might eval be changed to accommodate for that (without introducing the > name local-eval)? It would likely help with unasking the question of what to do when (current-module) is different at the time of local-eval. I don't know, however, what the _lexical_ effects of switching the current module are supposed to be. If it is supposed to be a noop, then lexical environments and modules are presumably orthogonal, and eval should likely be allowed to take both (currently, local-eval is like taking a lexical environment and using primitive-eval in it). -- David Kastrup