Hi Rob,
I left GOOPS development at Guile version 1.8. The way this was then intended to work was that
(define-generic equal?)
means that you want to create a new generic equal?. This discards the old binding for equal?.
(define-method (equal? (a <string>) (b <string>)) ...)
on the other hand, means that you want to *extend* the current behavior of equal? with a specialization to two strings. The method is then added to equal?, which in guile-1.8 was from scratch a "primitive-generic".
Here's the actual output of guile-1.8:
guile> equal?
#<primitive-generic equal?>
guile> (use-modules (oop goops))
guile> (define-method (equal? (a <string>) (b <string>)) (string=? a b))
guile> equal?
#<primitive-generic equal?>
guile> (primitive-generic-generic equal?)
#<<generic> equal? (2)>
guile> (define-generic equal?)
guile> equal?
#<<generic> equal? (0)>
I don't know if the changes between 1.8 and 2.2.6 is intentional or a bug. Does someone here know?
Best regards,
Mikael