From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Marius Vollmer Newsgroups: gmane.lisp.guile.devel Subject: Re: Bug in eval-string? Date: 08 Aug 2002 23:03:56 +0200 Sender: guile-devel-admin@gnu.org Message-ID: <878z3hukoz.fsf@zagadka.ping.de> References: <20020808125641.GA23831@www> NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1028840601 15251 127.0.0.1 (8 Aug 2002 21:03:21 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Thu, 8 Aug 2002 21:03:21 +0000 (UTC) Cc: guile-devel@gnu.org Return-path: Original-Received: from fencepost.gnu.org ([199.232.76.164]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 17cuRD-0003xq-00 for ; Thu, 08 Aug 2002 23:03:20 +0200 Original-Received: from localhost ([127.0.0.1] helo=fencepost.gnu.org) by fencepost.gnu.org with esmtp (Exim 3.35 #1 (Debian)) id 17cuRw-0008Jd-00; Thu, 08 Aug 2002 17:04:04 -0400 Original-Received: from dialin.speedway43.dip164.dokom.de ([195.138.43.164] helo=zagadka.ping.de) by fencepost.gnu.org with smtp (Exim 3.35 #1 (Debian)) id 17cuRp-0008Ie-00 for ; Thu, 08 Aug 2002 17:03:57 -0400 Original-Received: (qmail 29279 invoked by uid 1000); 8 Aug 2002 21:03:56 -0000 Original-To: rm@fabula.de Original-Lines: 25 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 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:1026 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.devel:1026 rm@fabula.de writes: > (let ((interaction-environment (lambda () boxx))) > (format #t "Meaning of life in a box is: ~A\n" > (eval-string "meaning-of-life"))) Scheme 'let' creates new lexical variables, it doesn't dynamically bind existing variables like Elisp 'let' would. Your interaction-environment is a separate variable from the interaction-environment variable used by eval-string. To dynamically bind the current module (which is the same as the interaction-environment), use save-module-excursion together with set-current-module. (save-module-excursion (lambda () (set-current-module boxx) (format ...))) Yes, this could be prettier. What about adding "with" as a general dynamic scoping construct? (with ((current-module) boxx) ...) _______________________________________________ Guile-devel mailing list Guile-devel@gnu.org http://mail.gnu.org/mailman/listinfo/guile-devel