This is the mail archive of the
kawa@sources.redhat.com
mailing list for the Kawa project.
Inspecting the environment
- To: kawa at sourceware dot cygnus dot com
- Subject: Inspecting the environment
- From: Mark Beierl <mark at texar dot com>
- Date: Fri, 11 May 2001 13:59:38 -0400
Hi, all!
I've come up against a bit of a puzzling problem for me while using Kawa
1.6.58. If I want to look up a binding in the Environment using the
lookup method, I must have the interned name of the binding for the
lookup to succeed. But what happens if I have a copy of the String for
which binding I am searching? How do I get the interned name?
Sample:
public static void testEnv() throws Throwable {
Scheme interp = new Scheme();
/* This finds the binding for define */
System.err.println("Binding =
"+interp.kawa_environment.lookup("define"));
BufferedReader in = new BufferedReader(new
InputStreamReader(System.in));
String binding = "";
/* Have the user input the word define, and ... */
while( !(binding = in.readLine()).equals("") ) {
/* it fails to be found. */
System.err.println("Binding =
"+interp.kawa_environment.lookup(binding));
}
}
And so, does anyone know what can I do in this case?
Thanks in advance.
Regards,
Mark