Re: Allowing incongruent methods
Eduardo Cavazos <[email protected]> Sun, 18 Jul 2004 04:56:14 -0500
| Newsgroups | gmane.comp.lang.goo.general |
|---|---|
| Message-ID | <[email protected]> |
It turns out that RScheme is able to handle 'incongruent methods' afterall.
Donovan Kolbly (RScheme designer) pointed out to me that a module
called 'rs.sys.multimethod' can be loaded to provide the needed
functionality. Here's the example I gave in my first method, written
to use this module:
,(use rs.sys.multimethod)
(define-mm-generic-function range*)
(define-method range* (a b step)
(if (> a b)
'()
(cons a (range* (+ a step) b step))))
(define-method range* (a b)
(range* a b 1))
(define-method range* (b)
(range* 1 b 1))
PS: Sorry if this is off topic, but in my first message I noted that
RScheme didn't seem to handle this so I wanted to correct my
statement.