-
Notifications
You must be signed in to change notification settings - Fork 282
Omit parentheses in threading macros when optional #207
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
Comments
Yeah, that's a good guideline to have. PR welcome! :-) |
The wording of this is incorrect and misleading on how the threading macro works. A function that takes zero arguments would break the threading of the threading macro unless its the very first in the sequence. Each following function must take at least one argument otherwise an arity exception would be called as proceeding lines are passing an argument into the next line - it is the result of each expression that is threaded through the threading macro. I assume this is why it has this name. The idiom more specifically is: parens must be used when functions have more than one argument, otherwise the parens are optional. I would disagree that its bad style to include parens, they are simply optional. The language used for this style could be more constructive too. Perhaps finding a way to widen the review of style guide lines is something to consider. |
What's wrong with the wording exactly? "functions having no argument specified" is not the same as a function with 0 arguments, so to me it seems that the wording is correct, although probably there's some room for improvement.
Well, it's not necessary bad, it's just not very common either. We can make this more explicit in the description.
I keep issues open for a very long time to solicit some conversations, but usually people join the conversations only when something gets merged. 😆 We can certainly do better, but I also don't want to run around looking for input. In general it seems to me that the guideline is not bad, but it can be worded better. |
I find the term "specified" quite vague. Specify sounds more like a function definition than a function call, hence why I found the description could lead to the assumption that the rule was for functions that did not take any arguments. Argument are passed to a function, or a function is called with arguments, or a function that takes x number of arguments.
The community doesnt tend to actively watch a GitHub repository unless they are raising an issue or pull requests. Adding a channel to the Clojurians slack / zulip for discussions could help widen the discussion. The same issue of late comments has occurred when contributing key bindings to Spacemacs, so I posted links to issues and PRs as I raised them to elicit discussion. There are also other channels where the community lives that could help. |
Yeah, I totally get this. Adding some channel about conversations on Slack seems like a good idea. |
Parentheses are not required when using the threading macros for functions having no argument specified, so use them only when necessary.
The text was updated successfully, but these errors were encountered: