I just ran into this error "nested captures via & are not allowed" having
no nested captures whatsoever,, but using captures in a chain of operations
with custom operator, like this:
`value ~> &op/1 ~> &op2/1` where ~> is basically an alias for some
function, so when rewritten it looks like this
Ah, thanks, parentheses indeed fix that.
On Friday, September 11, 2020 at 2:48:42 PM UTC+2 José Valim wrote:
> The & has low precedence (low binding). Therefore, "value ~> &op/1 ~>
> &op2/1" is being parsed as "value ~> &(op/1 ~> &op2/1)", which is where the
> warning comes from.
>
> Proof:
>
>
I realize it might be controversial, but I truly enjoy short form lambdas
in any language I touch and Elixir is one of them. Yet I think there's a
couple of use cases that are uncovered. One is when you need to encode a
zero argument lambda returning a value and the second one is when there are