This is the mail archive of the
kawa@sources.redhat.com
mailing list for the Kawa project.
Re: new Scheme()
Dean Ferreyra wrote:
I do still have a point of confusion about environments, though I don't
think it affects our current code. Can users maintain separate
environments explicitly? This Java snippet generates a
NullPointerException for me:
kawa.standard.Scheme.registerEnvironment();
kawa.standard.Scheme scm = kawa.standard.Scheme.getInstance();
gnu.mapping.Environment env = scm.getNewEnvironment();
scm.eval( "(define a 1)", env );
when trying to expand "(define ...)" or other macros.
Actually I am seeing these exceptions when I'm running our production
code. For example, this simple test fails for me when trying to
expand the 'when in a compiled module:
(eval `(when #t #t))
Undoing the attached CVS change seems to get things working again.
Dean
Index: kawa/lang/Translator.java
===================================================================
RCS file: /cvs/kawa/kawa/kawa/lang/Translator.java,v
retrieving revision 1.111
retrieving revision 1.112
diff -a -u -r1.111 -r1.112
--- kawa/lang/Translator.java 4 Mar 2005 19:25:26 -0000 1.111
+++ kawa/lang/Translator.java 29 Mar 2005 22:11:08 -0000 1.112
@@ -727,7 +727,7 @@
return syntaxError("not implemented: variable reference to a method");
if (decl != null && decl.getContext() instanceof PatternScope)
return syntaxError("reference to pattern variable "+decl.getName()+" outside syntax template");
-
+
ReferenceExp rexp = new ReferenceExp (nameToLookup, decl);
if (function && separate)
rexp.setFlag(ReferenceExp.PREFER_BINDING2);
@@ -939,17 +939,14 @@
String save_filename = getFile();
int save_line = getLine();
int save_column = getColumn();
- Compilation save_comp = Compilation.getCurrent();
try
{
- Compilation.setCurrent(this);
setLine(st_pair);
syntax.scanForm(st_pair, defs, this);
return;
}
finally
{
- Compilation.setCurrent(save_comp);
setLine(save_filename, save_line, save_column);
}
}