3 ms·
Elixir drops parentheses in function calls, too. Unless it's an anonymous function. Or unless it's a function you pipe to. There are other syntax quirks as wel
by dmitriid 8y ago
Elixir drops parentheses in function calls, too. Unless it's an anonymous function. Or unless it's a function you pipe to.
There are other syntax quirks as well. A very very very opinionated take on Elixir syntax: https://medium.com/@dmitriid/in-which-i-complain-about-elixir-syntax-54a34c3033f5 https://medium.com/@dmitriid/in-which-i-complain-about-elixi... :)
(Note: I haven't touched Elixir in a while, so some of the things there may be wrong)
- Ndymium 8y agoElixir has optional parentheses but they are discouraged in most cases and the official formatter will add them back, so at least there is a community opinion.
- mercer 8y agoThe formatter, as Ndymium mentions, fixes a lot of this. Optional parentheses were one of my main issues with Elixir, but once I understood why this choice was made, and what with the formatter judiciously adding them back in, I'm much happier. (I recall having tons of issues when using the pipe operator + leaving out parentheses. Happy that these aren't much of an issue anymore.)