``` iex> length([1, 2, 3]) == length [1, 2, 3] true ```
or (taken from the Elixir docs):
---
Take the following code:
``` if variable? do Call.this() else Call.that() end ```
Now let’s remove the conveniences one by one:
do-end blocks are equivalent to keywords:
`if variable?, do: Call.this(), else: Call.that()` Keyword lists as last argument do not require square brackets, but let’s add them:
`if variable?, [do: Call.this(), else: Call.that()]` Keyword lists are the same as lists of two-element tuples:
`if variable?, [{:do, Call.this()}, {:else, Call.that()}]` Finally, parentheses are optional, but let’s add them:
`if(variable?, [{:do, Call.this()}, {:else, Call.that()}])` That’s it! Those four rules outline the optional syntax available in Elixir. Those rules apply everywhere consistently, regardless of the construct you are invoking. Whenever you have any questions, this quick walk-through has you covered.
---
I don't like this possiblity to use so many syntaxes good, especially if you deal with mulitple parameters in functions. Elixir doesn't have C-like semicolons or braces like in Lisp so multiple parameters are hard to parse sometimes.
The creator of Elixir himself answered that one of the things he thinks he could do better at the beginning was to make the syntax more strict and he mentions the optional () e.g. IO.puts "Hello" vs IO.puts("Hello").