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

Listing class methods? #3

Open
vindarel opened this issue Jun 6, 2022 · 5 comments
Open

Listing class methods? #3

vindarel opened this issue Jun 6, 2022 · 5 comments

Comments

@vindarel
Copy link

vindarel commented Jun 6, 2022

Hello dear lisper,

I see that the help buffer for a class has a "methods" entry. I was expecting it to list the class's methods, but it seems to list methods that have the same name of the class.

We just talked on Discord we can get the list of methods with

(defclass footest () ())
(defmethod foo-method ((obj footest)) :yep)
(closer-mop:specializer-direct-methods (find-class 'footest))

If I add

(defmethod footest () :arg)

the help buffer will show footest but not foo-method.

Wouldn't be a great addition?

@mmontone
Copy link
Owner

mmontone commented Jun 6, 2022

Yes. I see there's something not quite right there. I'll try to change.

@mmontone
Copy link
Owner

mmontone commented Jun 6, 2022

I'm having trouble with your example.

Current implementation uses swank-backend:who-specializes. I could change to closer-mop, blindly, but I would like to understand the problem better.

FOO-TEST> (closer-mop:specializer-direct-methods (find-class 'footest))
(#<STANDARD-METHOD FOO-TEST:FOO-METHOD (FOOTEST) {1006FAE3A3}>)
FOO-TEST> (swank-backend:who-specializes (find-class 'footest))
(((DEFMETHOD FOO-METHOD)
  (:ERROR
   "Error: DEFINITION-SOURCE of function (METHOD FOO-METHOD) did not contain meaningful information.")))

Can you help me with an example where swank-backend:who-specializes and closer-mop:specializer-direct-methods differ ?

@mmontone
Copy link
Owner

mmontone commented Jun 7, 2022

I see that the help buffer for a class has a "methods" entry. I was expecting it to list the class's methods, but it seems to list methods that have the same name of the class.

Also note that only exported symbols are listed only atm.

@vindarel
Copy link
Author

vindarel commented Jun 7, 2022

Strange, I don't have your error with swank-backend, it works too.

(swank-backend:who-specializes (find-class 'footest))

(((DEFMETHOD FOO-METHOD)
  (:LOCATION
   (:BUFFER-AND-FILE "cmdcollectivites.lisp"
    "/home/vince/projets/foo/src/cmdcollectivites.lisp")
   (:OFFSET 18381 0) (:SNIPPET "(defmethod foo-method ((obj footest)) :yep)"))))

Did you write my example class and method on the REPL? I wrote them in a file.

@mmontone
Copy link
Owner

mmontone commented Jun 7, 2022

Yes, but I don't know what this is:

(defmethod footest () :arg)

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

2 participants