From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andy Wingo Newsgroups: gmane.lisp.guile.devel Subject: Re: Can't get outside bindings in the string expression with eval-string Date: Tue, 18 Oct 2011 16:59:32 +0200 Message-ID: <87ipnm8hwr.fsf@pobox.com> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1318949987 1760 80.91.229.12 (18 Oct 2011 14:59:47 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 18 Oct 2011 14:59:47 +0000 (UTC) Cc: guile-devel To: Nala Ginrut Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Tue Oct 18 16:59:43 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 1RGB8o-0000WX-RK for guile-devel@m.gmane.org; Tue, 18 Oct 2011 16:59:43 +0200 Original-Received: from localhost ([::1]:41191 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RGB8n-0003g3-Ez for guile-devel@m.gmane.org; Tue, 18 Oct 2011 10:59:41 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:48590) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RGB8k-0003fj-K0 for guile-devel@gnu.org; Tue, 18 Oct 2011 10:59:39 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RGB8j-0000DU-9F for guile-devel@gnu.org; Tue, 18 Oct 2011 10:59:38 -0400 Original-Received: from a-pb-sasl-sd.pobox.com ([74.115.168.62]:60529 helo=sasl.smtp.pobox.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RGB8j-0000DQ-6a for guile-devel@gnu.org; Tue, 18 Oct 2011 10:59:37 -0400 Original-Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-sd.pobox.com (Postfix) with ESMTP id CFA2F6845; Tue, 18 Oct 2011 10:59:36 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type:content-transfer-encoding; s=sasl; bh=+hHPI/981wS6 nHuqTHst+ZMFxL4=; b=MsgOmGerUgrPSUzjn/TN8nx1pAWdF8Kh0NjpHJzROVSY xlqFeSTDPwOl1KvRTZB+oGeSygqvl5JWk1LkpjobzrZ0AnK4aBwWwL5F7eHiADKz 3RipJD+obXjPS+Tz4CCbmcw0g2yRtKNkkvD6Ct6ga5IzJkJVECeGI5tYDmT87ow= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type:content-transfer-encoding; q=dns; s=sasl; b=pfmayi 49H/wouAhx31JiftGFsYtdFRnwno2HFaCyH4YNIlNM2zAsnmMfrXyWipzJwtCksy j1UTsET6jCYLDPwYcSt5yTcvMPvLtJfN2XfvZiteIxncHR4mlp001Xhiuyg64oWM 2Ck1tKqhY/k9+i8zqSsgcD+EIbQ6hwF1z0PuI= Original-Received: from a-pb-sasl-sd.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-sd.pobox.com (Postfix) with ESMTP id C93826844; Tue, 18 Oct 2011 10:59:36 -0400 (EDT) Original-Received: from badger (unknown [90.164.198.39]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by a-pb-sasl-sd.pobox.com (Postfix) with ESMTPSA id 3ED506843; Tue, 18 Oct 2011 10:59:36 -0400 (EDT) In-Reply-To: (Nala Ginrut's message of "Tue, 18 Oct 2011 22:32:14 +0800") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux) X-Pobox-Relay-ID: CBB44074-F999-11E0-97D1-65B1DE995924-02397024!a-pb-sasl-sd.pobox.com X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta) X-Received-From: 74.115.168.62 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:12846 Archived-At: On Tue 18 Oct 2011 16:32, Nala Ginrut writes: > -----------------------wrong code------------------------------ > (define (func) > =C2=A0 =C2=A0(let ((fp (open-output-file "/tmp/aaa"))) > =C2=A0 =C2=A0 =C2=A0 =C2=A0(eval-string "(write 123 fp)" (current-module)) > =C2=A0 =C2=A0 )) > -----------------------end code------------------------------------ `fp' is a lexical binding, not a module-level binding. So no, this won't work. You won't be able to get to lexical variables via `eval' (or `eval-string'). Andy --=20 http://wingolog.org/