This is the mail archive of the
kawa@sources.redhat.com
mailing list for the Kawa project.
Defining Java Classes in Kawa
- From: David O'Callaghan <David dot OCallaghan at cs dot tcd dot ie>
- To: Kawa Mailing List <kawa at sources dot redhat dot com>
- Date: Mon, 23 Aug 2004 17:22:38 +0100
- Subject: Defining Java Classes in Kawa
Hello All,
I'm interseted in using Kawa to provide a functional-programming
interface to an existing Java framework. This requires a developer to
extend one of a few core classes and provide and implementation. I would
like to be able to define such implementations in Scheme and later I
hope to be able to wrap these class definitions in macros to further
hide the Java API. The classes defined would need to be compatible with
similar classes written in "Pure Java".
Some of the classes to be defined will need a non-default constructor.
They will also need to call the super-class constructor. An example in
Java looks like this:
public class MyNode extends Node {
public MyNode(Graph g) {
super(g, 2);
this.setVar(new MyVar());
}
}
As far as I can tell, it's not possible to define a non-default
constructor in Kawa, or to call the super-class constructor, based on
http://sources.redhat.com/ml/kawa/2003-q4/msg00085.html.
Is there some way to do what I want in Kawa as it stands? If not, where
would I start to try adding this functionality to Kawa?
Kind regards,
David O'Callaghan