This is the mail archive of the kawa@sourceware.org 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]

OOP with Kawa


Hello,

I am starting object oriented programming with Kawa :

(define (printf v . args)
    (apply format #t v args))

(define-simple-class <building>()
    (x type: int)
    (y type: int)
    (name type: string)
    )

(define f
    (<building>
        x: 5
        y: 7
        name: "farm"))

(define (displayln v)
    (display v)
    (newline))
(displayln "creating class...")

(printf "~A : (~D, ~D)" f:name f:x f:y)(newline)
(set! f:x 6)
(printf "~A : (~D, ~D)" f:name f:x f:y)(newline)


I get the following warnings :
test3.scm:22:25: warning - no known slot 'name' in java.lang.Object
test3.scm:22:32: warning - no known slot 'x' in java.lang.Object
test3.scm:22:36: warning - no known slot 'y' in java.lang.Object

The Kawa documentation lacks examples.
Could someone provide me with OOP examples ?

Thanks,
JÃrÃme



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