Thank you
caseandwithare special forms and directly implemented in the compiler. You cannot use those arrows as is within functions/macros
I can see that
But the question is still unanswered. I can use -> outside cases and withs
Like this:
iex(1)> defmodule X do
...(1)> defmacro x(x), do: quote(do: unquote(inspect(x)))
...(1)> end
{:module, X,
<<70, 79, 82, 49, 0, 0, 4, 220, 66, 69, 65, 77, 65, 116, 85, 56, 0, 0, 0, 157,
0, 0, 0, 16, 8, 69, 108, 105, 120, 105, 114, 46, 88, 8, 95, 95, 105, 110,
102, 111, 95, 95, 10, 97, 116, 116, 114, ...>>, {:x, 1}}
iex(2)> import X
X
iex(3)> x 123
"123"
iex(4)> (1 -> 2) |> x()
"[{:->, [line: 4], [[1], 2]}]"
iex(5)> x(1 -> 2)
** (SyntaxError) iex:5:5: syntax error before: '->'
So, is there any idea behind this behaviour? Or is it just a bug?




















