This is the mail archive of the
kawa@sources.redhat.com
mailing list for the Kawa project.
Re: How do classes work?
- From: Per Bothner <per at bothner dot com>
- To: Ranjan Bagchi <ranjan dot bagchi at frotz dot com>
- Cc: kawa at sources dot redhat dot com
- Date: Mon, 27 May 2002 22:01:47 -0700
- Subject: Re: How do classes work?
- References: <3CF27FCB.8020207@frotz.com>
Ranjan Bagchi wrote:
> A couple questions: I'm creating classes with define-simple-class, and
> have a few questions:
> ** How do I define a constructor?
define-class and define-simple-class are inspired by Goops (in Guile),
inspired by Stklos, inspired by CLOS. These frameworks use a generic
initalize method, which you can specialize for the class, though I
believe most classes just use the default behavior, which is to use
the init-form and init-keyword slot specifiers. Kawa does not support
the initialize method, at least not yet, and you cannot declare
arbitary constructor methods.
It would be useful and not very difficult to support
Java-style constructors at least for define-simple-class.
> ** How do I call a superclass method?
I don't think this is implemented. My idea was to generalize
(this <classname>) so that <classname> could be this's superclass.
Again, it shouldn't be too difficult to implement, but I don't
know when I'll get around to it,
--
--Per Bothner
per@bothner.com http://www.bothner.com/per/