This is the mail archive of the guile@cygnus.com mailing list for the guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

eval in local environments



Hello there.

I need to load a number of files whose contents may not be the best scheme
code in the world. Now I'm wondering as to how best isolate these files.
Errors can be handled with catch, but it's disturbing that the files access
the top-level environment of the main script that's loading them. For
example, one of these files plain defines a procedure named map, which sort
of screws up my program.

So I would like to make my program robust and have the files to be loaded
have very limited access to the environment of my main program. How is this
done without modifying these files? Eval seems to always access the top
environment.. As a side note, (let ((a 'foo)) (eval 'a)) doesn't work (nor
does symbol-binding). How do I get the value in let's environment?

(For what it's worth, what I am doing is writing a new scheme extension to
the Gimp in guile, and I wish to be able to read the old script-fu scripts,
which use SIOD and are pretty awful scheme code anyway)


Lauri Alanko
la@iki.fi