--
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/75b06fc7-5be0-4070-8c49-6e2fb5779ea3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
HeyWe have elem/2, which is quite clear and more concise.We don't need specific functions for each index because we are not limited by a static type system and so the index does not need to be known at compile time.Cheers,Louis
On Fri, 5 Apr 2019, 11:29 Mário Guimarães, <mario.lui...@gmail.com> wrote:
Hello,--any reason why there are no easy readable idioms likefirst, snd, third, ..., tenth (I guess is enough)to access tuples?Thanks
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-l...@googlegroups.com.
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/da9cc177-513d-4683-8f4e-1c8b9c8286ca%40googlegroups.com.
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/876d9efd-f721-431a-b4c5-620876f2aaad%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Often times matching on the tuple size can make your program safer since it will crash on unexpected inputs. In cases like the one you mentioned, I would go with |> Enum.map(fn {x, _, _} -> x end).
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/876d9efd-f721-431a-b4c5-620876f2aaad%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--Andrea Leopardi