unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Nala Ginrut <nalaginrut@gmail.com>
To: guile-devel <guile-devel@gnu.org>
Subject: Re: Can't get outside bindings in the string expression with eval-string
Date: Wed, 19 Oct 2011 10:22:22 +0800	[thread overview]
Message-ID: <CAPjoZodfbv9KEVa3DBCN3dLQT07i5ku0xcL0gHAavFvnSKqFsQ@mail.gmail.com> (raw)
In-Reply-To: <CAPjoZoeUQ7aokEUzeQ1f+Ge1zPOkEQcLgwdTiC5YJtDRR2hrqg@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 660 bytes --]

On Tue, Oct 18, 2011 at 10:59 PM, Andy Wingo <wingo@pobox.com> wrote:

> On Tue 18 Oct 2011 16:32, Nala Ginrut <nalaginrut@gmail.com> writes:
>
> > -----------------------wrong code------------------------------
> > (define (func)
> >    (let ((fp (open-output-file "/tmp/aaa")))
> >        (eval-string "(write 123 fp)" (current-module))
> >     ))
> > -----------------------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
> --
> http://wingolog.org/
>


OK, I'll try another approach.

[-- Attachment #2: Type: text/html, Size: 1269 bytes --]

      parent reply	other threads:[~2011-10-19  2:22 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-18 14:32 Can't get outside bindings in the string expression with eval-string Nala Ginrut
2011-10-18 14:42 ` Nala Ginrut
2011-10-18 14:59 ` Andy Wingo
     [not found]   ` <CAPjoZoeUQ7aokEUzeQ1f+Ge1zPOkEQcLgwdTiC5YJtDRR2hrqg@mail.gmail.com>
2011-10-19  2:22     ` Nala Ginrut [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAPjoZodfbv9KEVa3DBCN3dLQT07i5ku0xcL0gHAavFvnSKqFsQ@mail.gmail.com \
    --to=nalaginrut@gmail.com \
    --cc=guile-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).