This is the mail archive of the
kawa@sources.redhat.com
mailing list for the Kawa project.
RE: importing java packages
- From: "Dominique Boucher" <dominique dot boucher at nuecho dot com>
- To: "'Chris Dean'" <ctdean at sokitomi dot com>, <kawa at sources dot redhat dot com>
- Date: Thu, 17 Mar 2005 14:05:27 -0500
- Subject: RE: importing java packages
- Reply-to: <dominique dot boucher at nuecho dot com>
> How about this alternate feature:
>
> (define-package-namespaces <java.awt>)
>
> which would create (define-namespace JFrame <java.awt.JFrame>) etc.
Nice. But is it possible? Can you access all classes of a given package in
Java,
without scanning directories/Jar files manually? I may be mistaken, but the
standard java.lang.Package class does not provide any introspection
methods...
> What I really would like is if Kawa provided me the tools so
> I could write this feature in Scheme myself with access to
> the compiler source code.
Apart from the class loading problems, I think a macro would do a decent job
in
this case.
But I would also like a simple and clean API (Scheme or Java, I don't mind)
for compiling Scheme
files to .class files. This would make integrating the compiler in IDEs like
Eclipse easier. There are
a number of problems with the way Kawa compiles multiple files (at least for
doing what I have in mind).
For example, not all class files are immediately written to disk. Kawa
resorts
to registerShutdownHook to ensure that all ports are closed. This means that
sometimes you
compile a file A to a .class, then you try to compile B, which depends on A.
But the compilation
of B will fail since A.class has not been written yet, or it sees an older
version of A.class.
Or did I miss something?
Dominique