-
Notifications
You must be signed in to change notification settings - Fork 629
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
Tests for more Clojure tags #4126
base: master
Are you sure you want to change the base?
Conversation
0a77b74
to
01fc488
Compare
Thank you for making this pull request. I will merge this with some revising. |
[& _] | ||
nil) | ||
|
||
(defmethod test :test2 named-method |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you explain this line?
I wonder why named-method
should be extracted because my knowledge of Clojure is limited.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a method-specific name that's added to multimethod function name. See https://clojuredocs.org/clojure.core/defmethod#example-542692c7c026201cdc3269cd
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I need help understanding.
Can named-method be used with a function?
I guess, with the name, a user can call the method by passing multi-method-dispatching. If my guessing is correct,I think 'named-method' should be tagged as a function, not a method.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, it doesn't work as a self-sufficient function. It's merely a piece of metadata identifying the method. It's only useful in debugging and (given ctags support) in location search.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see. Thank you. We should introduce a new kind for such a language object. What do Clojure hackers call it? I think of method-identifier/i
or method-id/i
.
The ideal tags for named-method
looks like:
named-method input.clj /^(defmethod test :test2 named-method$/;" i multimethod.test method:test
test input.clj /^(defmethod test :test2 named-method$/;" m multimethod.test identifier:named-method
Anyway, the current Clojure parser cannot extract caddr.
So, to satisfy these new test cases, we must rewrite the parser.
Hi! Here's some Clojure tests for #4123. That's not all, but it's the most frequently used things—vars and multimethods.