This is the mail archive of the
kawa@sourceware.org
mailing list for the Kawa project.
OOP with Kawa
- From: JÃrÃme Brilland <jeromebri at gmx dot fr>
- To: kawa at sourceware dot org
- Date: Mon, 01 Dec 2014 21:13:31 +0100
- Subject: OOP with Kawa
- Authentication-results: sourceware.org; auth=none
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