2 ms·
> > Enum.map(fn x -> elem(x, 1) end) Yes, this is actually more readable to me (a non-Elixir user). This syntax is explicit about what is happening. > fn a, b
by intertextuality 8y ago
> > Enum.map(fn x -> elem(x, 1) end)
Yes, this is actually more readable to me (a non-Elixir user). This syntax is explicit about what is happening.
> fn a, b -> x.(b, a) end
Yes, this is more clear!
I'm not going to discuss whether these are good or bad in the context of Elixir, but I do think the former examples are much more clear than the ones with the indices. Since Elixir uses arity notation it makes more sense, at least.
These have no place in Ruby, however.