I'd support Enum.pop, which would return an element and an new enumerable without the element.
On Thu, Feb 16, 2017 at 3:20 AM José Valim <[email protected]> wrote: > Because enumerables have no guarantee of ordering, so the notion of first > can be misleading. You can use Enum.at(..., 0) but also with the disclaimer > that it can be anything within a data-structure that does not provide order. > > > > *José Valim* > www.plataformatec.com.br > Skype: jv.ptec > Founder and Director of R&D > > On Thu, Feb 16, 2017 at 12:02 PM, Sam Vervaeck <[email protected]> > wrote: > > Hi, > > I've found List.first and List.rest, but I couldn't find Enum.first and > Enum.rest. Is there any reason this is only implemented for lists? I can > think of a few cases were this would be useful. Any recursive algorithm > that runs following the prescription "take one element out the bunch, > process it, and take care of the rest later" would, I think, benefit from > it. > > Kind regards, > Sam > > -- > 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/5fa50f90-72b2-4c73-a012-de052f4c036b%40googlegroups.com > <https://groups.google.com/d/msgid/elixir-lang-core/5fa50f90-72b2-4c73-a012-de052f4c036b%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > > > -- > 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/CAGnRm4KG59KQbmZmhp7pTzkrO%2BF0T2M7_cZhbUT5tKfLgoczyg%40mail.gmail.com > <https://groups.google.com/d/msgid/elixir-lang-core/CAGnRm4KG59KQbmZmhp7pTzkrO%2BF0T2M7_cZhbUT5tKfLgoczyg%40mail.gmail.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- 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/CAOMhEnyJD5%2BCeGxPU_WuJXRT10MJWUk7x7zNHKagQFBZY%3DG%2BTQ%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
