I considered the option but I prefer to avoid using options that change the return type.
On Tue, Dec 8, 2020 at 9:11 PM Felipe Stival <[email protected]> wrote: > I'm not sure. Sounds a bit ambiguous, couldn't this be an option for a new > Enum.with_index/3? > > Em ter., 8 de dez. de 2020 às 17:05, José Valim <[email protected]> > escreveu: > >> I would like to propose an Enum.index/2 function. It behaves like >> with_index/2 but the index is the first argument: >> >> iex> Enum.index([:a, :b, :c]) >> [{0, :a}, {1, :b}, {2, :c}] >> >> I am hoping it reads "index" this tuple (hence the index as the first >> element. While with_index means attach an index information to each element >> (hence the second element). Is this sound? >> >> Thank you, >> >> -- >> 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 [email protected]. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/elixir-lang-core/CAGnRm4K6h7c1UbiEfoEsyCXGJRbO8he%3DFJ84yxC%2B3-GOo-2MwQ%40mail.gmail.com >> <https://groups.google.com/d/msgid/elixir-lang-core/CAGnRm4K6h7c1UbiEfoEsyCXGJRbO8he%3DFJ84yxC%2B3-GOo-2MwQ%40mail.gmail.com?utm_medium=email&utm_source=footer> >> . >> > > > -- > [image: logo] > *Felipe Stival,* Electrical Engineering Student > Santa Maria, Rio Grande do Sul > Brasil > v0idpwn.github.io > [image: Facebook] <https://facebook.com/v0idpwn> [image: Twitter] > <https://twitter.com/v0idpwn> [image: LinkedIn] > <https://linkedin.com/in/v0idpwn> [image: Github] > <https://github.com/v0idpwn> > > -- > 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 [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/elixir-lang-core/CAKC64%2Bx4zERK_axkS2puMT9Qa8dJKYEh_Z3QNDf977eJG0-6aw%40mail.gmail.com > <https://groups.google.com/d/msgid/elixir-lang-core/CAKC64%2Bx4zERK_axkS2puMT9Qa8dJKYEh_Z3QNDf977eJG0-6aw%40mail.gmail.com?utm_medium=email&utm_source=footer> > . > -- 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 [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/CAGnRm4Kj%3DS54yn-1jmoaG%2BKEab9ZLpagHYDfpNEu%2BSbtTdj%2B4g%40mail.gmail.com.
