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]
Other format: [Raw text]

Re: KAWA - define-generic


Chris Bitmead wrote:
Is there something in Kawa like define-generic?
There is 'make-procedure' (which is documented in the manual),
and 'define-procedure' (which isn't documented but should be).
Both of these require that all the methods be supplied in the
call to 'make-procedure' or 'define-procedure'.

It should be easy enough to implement define-generic and
define-method, but I haven't.

In any case, the support for generics needs a bit of work.
The *intent* is that the following shuld work:

(define-procedure Plus
  (lambda ((x :: <number>) (y :: <number>)) (+ x y))
  (lambda ((x :: <string>) (y :: <string>)) (string-append x y)))

- but it doesn't.  I don't know when I can get it working.
--
	--Per Bothner
per@bothner.com   http://www.bothner.com/per/


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