This is the mail archive of the kawa@sourceware.org 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: Calling getClass() on a Scheme subclassed object


There is special-case support for
  (static-field <CLASSNAME> 'class)
This is documented in the Kawa manual to return the java.lang.Class
object for CLASSNAME in the Kawa manual.  For some reason it returns
the gnu.bytecode.ClassType instead.  I'm a bit confused as to what is
going.  I'll take a look at it.

If you trying out this kind of code be warned that interpreted code may
act differently than compiled code in cases like this.  Ideally, it
shouldn't, but things do go through different code-paths whether they
are interpreted or compiled.  In principle such different behaviors are
bugs, but in a few cases the differences are unavoidable, given Kawa's
goal of good code quality.

If you're trying an expression on the command line or in a loaded file,
you can force it to be compiled by wrapping it in a lambda:
  ((lambda () EXPRESSION))

The way I'd like this problem to work is for there to be an automatic
conversion between gnu.bytecode.ClassType (or Type in general) and
java.lang.Class.  But that requires some infrastructure I haven't
implemented yet.
--
	--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]