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: A plea for local-eval in 2.0.4 Date: Sat, 14 Jan 2012 19:35:21 +0100 Organization: Organization?!? Message-ID: <87obu63zfa.fsf@fencepost.gnu.org> References: <87aa5s8uli.fsf@netris.org> <8762gg7yco.fsf@fencepost.gnu.org> <8739bj8tem.fsf@netris.org> <87boq777xz.fsf@fencepost.gnu.org> <87pqen6qho.fsf@netris.org> <87r4z264nf.fsf@fencepost.gnu.org> <87ty3y5kdo.fsf@netris.org> <87pqem5fnj.fsf@netris.org> <87wr8u40vg.fsf@fencepost.gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1326566153 2376 80.91.229.12 (14 Jan 2012 18:35:53 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 14 Jan 2012 18:35:53 +0000 (UTC) To: guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Sat Jan 14 19:35:50 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 1Rm8SC-0003ov-Vb for guile-devel@m.gmane.org; Sat, 14 Jan 2012 19:35:49 +0100 Original-Received: from localhost ([::1]:38404 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rm8SC-0007xJ-ES for guile-devel@m.gmane.org; Sat, 14 Jan 2012 13:35:48 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:39565) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rm8S2-0007x6-GE for guile-devel@gnu.org; Sat, 14 Jan 2012 13:35:46 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Rm8S1-0003Qx-4u for guile-devel@gnu.org; Sat, 14 Jan 2012 13:35:38 -0500 Original-Received: from lo.gmane.org ([80.91.229.12]:42361) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rm8S0-0003Qn-OT for guile-devel@gnu.org; Sat, 14 Jan 2012 13:35:37 -0500 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1Rm8Rz-0003kJ-5n for guile-devel@gnu.org; Sat, 14 Jan 2012 19:35:35 +0100 Original-Received: from p508ea5b6.dip.t-dialin.net ([80.142.165.182]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 14 Jan 2012 19:35:34 +0100 Original-Received: from dak by p508ea5b6.dip.t-dialin.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 14 Jan 2012 19:35:34 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 44 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: p508ea5b6.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:eqiBSBehhQAp3y0Ppuq1P/en+rY= 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:13503 Archived-At: David Kastrup writes: > Mark H Weaver writes: > >> Indeed, (local-eval '(set! x 5) ) is _not_ equivalent to >> (module-set! (current-module) 'x 5). > > To clarify: I was thinking about > > (local-eval '(set! x 5) ) vs > (local-eval '(module-set! (current-module) 'x 5) ) > >> Assuming that `x' is not locally bound within the captured lexical >> environment, the first sets `x' in the module captured by >> (the-environment), i.e. the module where `x' would have been set if you >> had put (set! x 5) in place of (the-environment). The second sets `x' >> in the (current-module) at the time of evaluation. > > Yes, that would be what I would expect given the two local-eval calls > above. Let me check with my "reference hack" on Guilev1: (define (my-eval form env) (call-with-current-continuation (lambda (x) (env (list x form))))) (define-macro (my-env) (call-with-current-continuation identity)) (display (save-module-excursion (lambda () (let ((env (my-env))) (set-current-module (resolve-module '(none))) (my-eval '(current-module) env))))) => # Even that agrees. Not that I would be eager to analyze why. -- David Kastrup