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]

how to define constructor methods in Scheme?


> I haven't found a way to define several or even a single constructor
> for a module written in Kawa.

If you mean that constructors aren't supported for define-simple-class,
then you're right.  You can simulate this by have a class <Foo> and
several normal functions (not methods) that create new <Foo>s with the
correct state: make-foo, make-foo-with-thing, etc...  Just call these
functions instead of the normal (make <Foo>) form.

On the other hand, if you are trying to use module semantics to map to
Java classes (or OOP in general), I don't believe that is the right way
to think about Kawa modules.

Regards,
Chris Dean


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