Seems like my mail got lost in my outbox. Attempt #2. I agree with Peter Hamilton, a Enum.pop method would be quite nice, though I understand the difficulties.
Sam > On 18 Feb 2017, at 01:20, Peter Hamilton <[email protected]> wrote: > > 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] > <mailto:[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 <http://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] > <mailto:[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] > <mailto:[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 > <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] > <mailto:[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 > <https://groups.google.com/d/optout>. > > -- > You received this message because you are subscribed to a topic in the Google > Groups "elixir-lang-core" group. > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/elixir-lang-core/-fFtCPJPV1o/unsubscribe > <https://groups.google.com/d/topic/elixir-lang-core/-fFtCPJPV1o/unsubscribe>. > To unsubscribe from this group and all its topics, send an email to > [email protected] > <mailto:[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 > > <https://groups.google.com/d/msgid/elixir-lang-core/CAOMhEnyJD5%2BCeGxPU_WuJXRT10MJWUk7x7zNHKagQFBZY%3DG%2BTQ%40mail.gmail.com?utm_medium=email&utm_source=footer>. > For more options, visit https://groups.google.com/d/optout > <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/30C3221B-805C-4DA2-A74A-B3C365514732%40skynet.be. For more options, visit https://groups.google.com/d/optout.
