V
Size: a a a
V
V
AU
DA
A
a
|>
такой высокий приоритет? А то из-за необходимости лишних скобок каждый раз задумываешься, стоит ли его использовать.unexpected comma. Parentheses are required to solve ambiguity in nested calls.
This error happens when you have nested function calls without parentheses. For example:
one a, two b, c, d
one(a, two(b, c, d))
? one(a, two(b, c), d)
?DA
one(a, two(b, c, d))
? one(a, two(b, c), d)
?
commit ebe522ec507e2a09190e658ab9f9923b54310f00 (HEAD)
Author: José Valim <jose.valim@plataformatec.com.br>
Date: Thu Jul 4 18:48:53 2013 +0200
Tighten up the grammar rules regarding parentheses omission
Prior to this commit, Elixir allowed too many ambiguous calls
by ommitting the parentheses:
do_something 1, is_list [], 3
[1, is_atom :foo, 3]
Both cases above would lead to a compilation error, as an attempt
to call is_list/2 and is_atom/2 would happen. Those examples will
now raise a syntax error, pointing to the ambiguous location.
We have disallowed such examples throughout the language with
the exception of one argument calls:
assert is_list []
Examples as above are extremely frequent and were kept as is.
ŹR
ДС
JS
P
ДС
DA
[1, is_atom :foo, 3]
рассматривался как [1, (is_atom :foo, 3)]
, что для is_atom/1 неверно, но справедливо для любой другой функции с арностью 2.DA
(func a, b, c)
вместо func(a, b, c)
.ŹR
ДС
ŹR
i = ++i + ++i
Compile error: undefined attitude
ŹR
ŹR
ŹR