fn () -> M.fun("value") &M.fun("value")** (CompileError) iex:28: invalid args for &, expected an expression in the format of &Mod.fun/arity, &local/arity or a capture containing at least one argument as &1, got: M.fun("value"))--
You received this message because you are subscribed to the Google Groups "elixir-lang-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elixir-lang-co...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/a8c88a03-3a3a-4161-bbe4-52f24e1592e9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
&1
&num/2
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/CAM9Rf%2BKJDRioz6hpw5-_ByvTNeTd8X-ecMFFXJyJrSsnzi4PXQ%40mail.gmail.com.
Furthermore there are intrinsic ambiguities:For example:&1Is that a function that returns 1 or is it a user error which forgot the outermost &?
And this example:&num/2Is that num divided by 2 or an attempt to capture the num function of arity 2?
So the reason why the capture operator requires at least one (consecutive) argument is to make the code clearer. And sure, the compiler could solve those, but the ambiguity will always be there for users reading the code.