The problem with the code I just sent:
(load "stklos")
(define-generic new-+)
(define-class <complex> () ())
(let ((+ +))
(define-method new-+ ((a <real>) (b <real>)) (+ a b))
(define-method new-+ ((a <complex>) (b <complex>)) 5)
(define-method new-+ ((a <number>)) 1)
(define-method new-+ () 0)
(define-method new-+ args (new-+ (car args) (apply new-+ (cdr args)))))
(set! + new-+)
(define c (make <complex>))
(+ c c c c)
is that the second method should return a complex. So if I replace
the dummy value 5 with (make <complex>), everything works.
Still, it would be nice to get a "no applicable method" error
instead of an infinite loop, if possible.
thanks again,
Jon
Received on Mon Feb 05 1996 - 00:53:16 CET
This archive was generated by hypermail 2.3.0
: Mon Jul 21 2014 - 19:38:59 CEST