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]

Strange things with "get-" prefix and native Kawa classes


Hi, is it correct behavior for Kawa? May be I don't understand something and I should not use functions with "get-" prefix for native kawa classes:

imdagger@thug-machine:~/Projects/Planets/util$ java -jar kawa-1.13.1.jar --version
Kawa 1.13.1 (revision 7415)
Copyright (C) 2012 Per Bothner

(define-simple-class A ()
    ((get-some-func) ::int 3))

(define-class B ()
    ((get-some-func) ::int 4)
    ((not-get-func) ::int 4))

(display (A):some-func) (newline)
(display ((A):get-some-func)) (newline)

(display (B):some-func) (newline)
(display ((B):get-some-func)) (newline)

(display ((B):not-get-func)) (newline)

** But I didn't expect to get two zeros in result **:

imdagger@thug-machine:~/Projects/Planets/util$ java -jar kawa-1.13.1.jar test.scm 
3
3
0
0
4

FYI: I checked decompiled version of this file, and I saw that here were two methods for get-some-func (static and non-static). And
static method returned default value (I understand that it's necessary method for internals).

-- 
Alex Moiseenko


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