This is the mail archive of the
kawa@sources.redhat.com
mailing list for the Kawa project.
Displaying contents of Environments; how are exported names bound?
- To: kawa at sourceware dot cygnus dot com
- Subject: Displaying contents of Environments; how are exported names bound?
- From: Jocelyn Paine <popx at pop3 dot ifs dot org dot uk>
- Date: Sat, 6 Oct 2001 19:22:36 +0100 (GMT)
What's the best way, from inside a Kawa function, to display all the
bindings in the current environment and its predecessors, right back to
the global ones?
Reason for asking this is something alluded to before. If, from inside a
compiled module M, I create a lambda-expression and eval it to make a
function F, bindings for functions defined in M don't seem to be getting
added to the environment in which F is compiled. So references from F to
names exported from M cause 'undefined variable' errors when F is
executed. The situation is actually more complicated, and I haven't yet
found out exactly where the failure is, which is why I ask about
displaying the contents of an environment.
A related question then: In a posting of 4 April 2001, Per says:
Note that Kawa has two different concepts: modules and environment.
They are related, an Environment is (run-time) data structure that you
can add bindings to. A module has a static set of exported names, and
can be instantiated, *resulting* in (something like) an Environment.
That set of exported names can be added to some other Environment.
Given an environment E that I have just created, and a compiled module M,
how can I add M's exported names to E?
Jocelyn Paine
http://www.ifs.org.uk/~popx/
+44 (0)7768 534 091