This is the mail archive of the
kawa@sourceware.org
mailing list for the Kawa project.
Re: Question regarding procedure compilation
Crystal, Mayer wrote:
I've been using kawa-1.7 for a while it was working well. I recently
tried to upgrade to 1.8 and received an error during procedure
compilation. I believe this is due to the updated code in LambdaExp
which makes a call to compileWithPosition. Essentially, my case is that
I have a string in memory that I wish to compile into a Procedure. The
compileWithPosition eventually makes a call to getLine() and then tries
to modify the source file. Since in my case I have no source file, this
throws an NPE. I have attached a sample piece of code to re-create my
issue and the stack trace that results. If there is a flag I should be
setting so that it calls compile instead of compileWithPosition, please
let me know.
The problem is you're using internal undoucmented interfaces in a way
they're not meant to be used. For one thing evalToClass needs a bunch
of "stuff" done before it gets called, at least in the current
implementation.
Why not just:
return (Procedure) scheme.eval("(lambda () "+rule+")");
It's not perfect (for one thing a syntax error will display the
wrong column number), but it is simple and documented.
--
--Per Bothner
per@bothner.com http://per.bothner.com/