This is the mail archive of the
kawa@sourceware.org
mailing list for the Kawa project.
Re: Exported variables are null when required from applet, but ok otherwise
- From: alex mitchell <lexaay at gmail dot com>
- To: Per Bothner <per at bothner dot com>, "kawa at sourceware dot org" <kawa at sourceware dot org>
- Date: Sun, 02 May 2010 12:57:55 +0800
- Subject: Re: Exported variables are null when required from applet, but ok otherwise
That would be great, thanks!
It seems to me that when modules are required from an applet, the module
body is not evaluated. Variables and procedures are declared but variables
aren't initialized, and any code in the module body isn't executed. I tried
adding (module-static 'init-run)
at the top of the imported module as I
figured this would force the module body to be run, but this caused the
following error when running in appletviewer:
$ appletviewer applettest.html
called init.
called start.
java.lang.IllegalAccessError
at test.<clinit>(test.scm)
at applettest.start(applettest.scm:6)
at sun.applet.AppletPanel.run(AppletPanel.java:464)
at java.lang.Thread.run(Thread.java:637)
$
A workaround would be to put in an "init" procedure in each module I
require, and then call that init procedure from the applet's "init", but I'd
rather not have to do this.
Alex
On 4/30/10 3:04 PM, "Per Bothner" <per@bothner.com> wrote:
> On 04/28/2010 09:38 PM, alex mitchell wrote:
>
>> Is there something special about compiling with the --applet flag that I'm
>> missing?
>
> Not that I know of, but I haven't done a lot of testing with applets.
> I hope I can take a look at this soon.