-
Notifications
You must be signed in to change notification settings - Fork 131
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
Macro invocation is treated as 'Unneeded anonymous function' #50
Comments
Another problem (similar) is that Java constructs are considered to be first-class functions, which they are not. So kibit currently recommends this:
But this is not correct, because (apply .toString [123])
(map Boolean. ["true" "false"]) but these do work: (apply #(.toString %) [123])
(map #(Boolean. %) ["true" "false"]) |
This is a fundamental limitation of kibit. I don't think there's a way to work around this but I'd be happy to hear ideas. |
@danielcompton, I don't currently follow how the lack of macro expansion (that I think you're referencing from the readme) means that this cannot be solved. Would it not be possible to e.g. change the rule so that any function name that begins or ends with Sorry if I've missed what you're getting at here. Cheers |
Gotcha. We can't cover the general case of all macros but it should be possible to exclude sugared Java interop. |
I see this output from kibit:
However taking kibit's advice results in the following compile error:
I guess the unneeded functions section of
misc.clj
needs to understand the difference between a function invocation and a macro invocation.The text was updated successfully, but these errors were encountered: