That's a really good point.
Maybe `indexed`? `with_index` sounds like perfect past for me, so this
would be similar. Still `index` is fine.

About the function itself, I find it useful and believe it should be on
Enum.

Em ter., 8 de dez. de 2020 às 17:14, José Valim <jose.va...@dashbit.co>
escreveu:

> 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 <v0id...@gmail.com> 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 <jose.va...@dashbit.co>
>> 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 elixir-lang-core+unsubscr...@googlegroups.com.
>>> 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 elixir-lang-core+unsubscr...@googlegroups.com.
>> 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 elixir-lang-core+unsubscr...@googlegroups.com.
> 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
> <https://groups.google.com/d/msgid/elixir-lang-core/CAGnRm4Kj%3DS54yn-1jmoaG%2BKEab9ZLpagHYDfpNEu%2BSbtTdj%2B4g%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 elixir-lang-core+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elixir-lang-core/CAKC64%2ByzPXZACSVB-orErnbmeTqR%3DDcAmkRbxoEFgaBJPYO4PQ%40mail.gmail.com.

Reply via email to