Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question about class-methods #683

Open
jpellegrini opened this issue Sep 1, 2024 · 0 comments
Open

Question about class-methods #683

jpellegrini opened this issue Sep 1, 2024 · 0 comments

Comments

@jpellegrini
Copy link
Contributor

Hi @egallesio !

I see that there is class-direct-methods, whose semantics is clear to me:

 (define-method method-A ((a <A>)) (print 'A))
 (define-class <C> (<A>) ())
 (define-method method-C ((c <C>)) (print 'C))

 (map method-generic-function (class-direct-methods <A>))
     => (#[<generic> method-A (1)])

But then I thought class-methods would list the methods specializing on a class and all its SUPERclasses (which are the ones that I would expect to apply to it), but its the opposite:

 (map method-generic-function (class-methods <A>))
     => (#[<generic> method-C (1)]
         #[<generic> method-A (1)])

It lists methods specialized on SUBclasses.

I couldn't find something like this in CLOS (I'm pretty sure it's there, I just can't find it)... And I was thinking -- would it be the case of having both? Upwards and downwards?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant