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]
Other format: [Raw text]

Re: new Scheme()


Dean Ferreyra wrote:
 > Up until recently this kind of construct worked for us:

public class Env { public static void main(String[] strings) { kawa.standard.Scheme.registerEnvironment(); kawa.standard.Scheme scm = new kawa.standard.Scheme(); scm.eval( "(require 'srfi-1)" );

but with the latest CVS pull I get a null pointer exception on the eval(). Adding a call to this:

scm.setEnvironment(scm.getNewEnvironment());

before the eval() seems to be the fix.

Is this right?

No, I don't think so. Creating a "new Scheme" is questionable; the changes I've been making are towards making langauges be "singleton classes" initialized at class initialization time.

Instead, try:
  kawa.standard.Scheme scm = kawa.standard.Scheme.getInstance();
  ... scm.getNewEnvironment() ...

This works, for now:
  ... scm.getEnvironment() ...
However, I'm not sure it will do so:  I think we want to move to a model
where the current "user environment" is language-independent.  That
implies that each language has an environment of predefined bindings,
but the user environment is thread-specific, not language-specific.
--
	--Per Bothner
per@bothner.com   http://per.bothner.com/


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