This is the mail archive of the kawa@sources.redhat.com mailing list for the Kawa project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: How do classes work?


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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]