[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: GOOPS generic methods and smobs
From: |
Mikael Djurfeldt |
Subject: |
Re: GOOPS generic methods and smobs |
Date: |
27 Oct 2000 22:37:24 +0200 |
User-agent: |
Gnus/5.0807 (Gnus v5.8.7) Emacs/20.7 |
"Lars J. Aas" <address@hidden> writes:
> 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)?
Yes.
> What is the class precedence list of a smob (is it directly under
> <top>,
Yes.
> and can I get Guile (GOOPS) to believe that one smob type is derived
> >From another smob for use in generic method arbitration?
No.
If your objects are related by inheritance, the recommended
representation will be GOOPS objects. However, we need to develop the
C API first.
Best regards,
/mdj