Problems with scoping of simple class definitions?

Per Bothner per@bothner.com
Thu Oct 14 21:04:00 GMT 2004


Dominique Boucher wrote:

> #|kawa:1|# (define-simple-class <A> (<Object>))
> #|kawa:2|# (make <A>)
> A@1de17f4
> #|kawa:3|# (define (is-an-A? x) (instance? x <A>))
> #|kawa:4|# (is-an-A? (make <A>))
> java.lang.NoClassDefFoundError: A

The problem is that we need to call the ClassLoader for
line 3 to use the <A> defined in line 1.  This has to be
done *in addition* to defining <A> in the global environment.
The fix to add a call to Compilation.usedClass.

I checked in the fix, plus a couple of other related fixes
and improvements.
-- 
	--Per Bothner
per@bothner.com   http://per.bothner.com/



More information about the Kawa mailing list