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]

Re: kawa objects


As Per said, object return an instance of an object.
If you want a class, you can minic it using a factory.
In Kawa you can do :

(define (make-user a-name a-password)
    (object ()
                (name a-name)
                (password a-password)
                ... ))

Each time you use (make-user ...), you get a new instance
of the same anonymous class.

Dennis a écrit :

> Hi,
>
> I can create a class using object:
>
> (define userClass (object ()
>                      (name "Dennis")
>                      (password "blah")
>                      ((validatePassword pw)
>                       .....
>                      )))
>
> But how do I create an instance of userClass and access fields and
> methods?
>
> --
> ---
> Dennis Sacks
> dennis@illusions.com


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