guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bug in eval-string?


From: Marius Vollmer
Subject: Re: Bug in eval-string?
Date: 08 Aug 2002 23:03:56 +0200
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2

address@hidden 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)
     ...)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]