Hi.
Suppose we have long equations and we want to split in multiple lines.
we would write something like...
(
2
*
3
)
or...
if true do
2
*
3
end
iex(11)> quote do
...(11)> 2
...(11)> *
...(11)> 3
...(11)> end
{:*, [context: Elixir, import: Kernel], [2, 3]}
But replacing * by + operator, it doesn't work same way
(
2
+
3
)
iex(10)> quote do
...(10)> 2
...(10)> +
...(10)> 3
...(10)> end
{:__block__, [], [2, {:+, [context: Elixir, import: Kernel], [3]}]}
+ is been parsed as unary operator and the code is splitted in two expressions
iex(12)> quote do
...(12)> 2;
...(12)> +3
...(12)> end
{:__block__, [], [2, {:+, [context: Elixir, import: Kernel], [3]}]}
It's equivalent to 2; +3
Obviously with function notation, we can split it without ambiguities
iex(36)> (Kernel.+ 1,
...(36)> (Kernel.* 2,
...(36)> 3))
Is there anyway to force single expression on multiple lines?
kind regards