[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

GOOPS generic methods and smobs

From: Lars J. Aas
Subject: GOOPS generic methods and smobs
Date: Fri, 27 Oct 2000 18:20:19 +0200
User-agent: Mutt/1.2.5i

I just discovered that I can use generic methods and smobs together,
something I didn't expect to work, nor have I seen it documented anywhere.

(define-method (test-method arg) (display "default\n"))
(define-method (test-method (arg <mysmob>)) (display "specific\n"))

(test-method "string")
=> default
(test-method (make-mysmob))
=> specific

Is this something that is supposed to work, and will work in the future
(as long as smobs are supported)?

What is the class precedence list of a smob (is it directly under <top>,
or?), and can I get Guile (GOOPS) to believe that one smob type is derived
from another smob for use in generic method arbitration?

  Lars J

reply via email to

[Prev in Thread] Current Thread [Next in Thread]