This is the mail archive of the
kawa@sources.redhat.com
mailing list for the Kawa project.
Re: Conforming to base classes [KAWA]
- To: chris at bitmead dot com
- Subject: Re: Conforming to base classes [KAWA]
- From: Per Bothner <per at bothner dot com>
- Date: 10 Sep 2000 07:34:51 -0700
- Cc: "kawa at sourceware dot cygnus dot com" <kawa at sourceware dot cygnus dot com>
- References: <39B72591.4C31B581@nimrod.itg.telecom.com.au>
Chris <chrisb@nimrod.itg.telstra.com.au> writes:
> I don't understand how to write a Kawa module that conforms to a Java
> base class. Like let's say I want to override hashCode from Object.
> hashCode returns an int. I can't just go...
>
> (define (hashCode) 1)
You should be able to do:
(define (hashCode) <int> 1)
or
(define (hashCode) :: <int> 1)
(The latter is very new but I think cleaner syntax.)
You also have to use
(module-static #f)
or use an explicit (module-extends ...) to prevent the
method from being static.
--
--Per Bothner
per@bothner.com http://www.bothner.com/~per/