This is the mail archive of the
kawa@sourceware.org
mailing list for the Kawa project.
Re: Using Kawa as an embedded scripting language
On 08/25/2011 11:38 AM, Jamison Hope wrote:
I'm not sure why that doesn't work,
The problem was that Kawa was generating the same class name for both evals.
The second eval compiles a reference to the class from the first eval - but
because it has the same class name, the class loader doesn't find the class.
I checked in a fix to generate unique class names - it should work now.
but I'm guessing that the one-argument
eval isn't using the right Environment. Try [two-argument eval] instead:
Aha! The one-argument eval ends up calling gnu.expr.Language.eval. However,
two-argument eval ends up calling kawa.lang.Eval#evalBody - which *does*
have
the necessary logic to set the class name. And coincidentally (?) the
same way.
(Great minds think alike - especially when it's the same mind a few
years apart.)
So things work now, but it seems some refactoring or code-sharing would
be appropriate.
--
--Per Bothner
per@bothner.com http://per.bothner.com/