This is the mail archive of the kawa@sources.redhat.com mailing list for the Kawa project.


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

Inspecting the environment


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



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