On 01/25/2011 02:25 PM, Jamison Hope wrote:
Once upon a time (before 1.10, probably), I was able to do something
like this:
$ cat Test.scm
(define-simple-class Test ()
((*init*) (display "Created an instance") (newline)))
but now when I try to compile it:
$ java kawa.repl -C Test.scm
(compiling Test.scm to Test)
Test.scm:2: internal error while compiling Test.scm
java.lang.Error: calling <init> on already-initialized object
at gnu.bytecode.CodeAttr.emitInvokeMethod(CodeAttr.java:1498)
It seems I can no longer define-simple-class a Java class with the name
of the Scheme file. That name gets reserved for a mandatory "module"
class, even if the simple-class is the only definition in the whole
file. Was it just an accident that it worked before?
Basically. It might work in some cases, but could easily break.
In fact, relatively recently I made changes just so this *should* work
more generally. And it does, if you leave out the *init*.
Haven't yet figured out why the *init* is causing problems,
but am looking into it.