Thanks. I was thinking about that too, but for this particular feature I believe there would be an issue. Please let me know what you think:
If we take Enum.zip as an example, it has a 1-arity version for accepting a list of enumerables and a 2-arity version accepting two single enumerables as arguments. If we wanted to allow for a default value in the zip/1 version it would conflict with the existing zip/2. On Monday, June 14, 2021 at 1:13:35 PM UTC-4 [email protected] wrote: > Not commenting on the feature itself, but I believe there's a convention > in the collection stdlib of keeping the same function names, but accept an > extra parameter, for default values. See: > > - Enum.find/3 > - Enum.find_value/3 > - Map.pop/3 > - Keyword.get/3 > > > On Sunday, June 13, 2021 at 10:27:53 AM UTC-7 [email protected] wrote: > >> Hi, >> >> Would the community be interested in adding versions of of the >> Enum/Stream zip functions that allow for a default value to be set when the >> enumerables aren't all the same length? I was thinking of the following >> name/arity combos: >> >> {Enum, Stream}.zip_all/2 >> {Enum, Stream}.zip_all/3 >> {Enum, Stream}.zip_all_with/3 >> {Enum, Stream}.zip_all_with/4 >> Enum.zip_all_reduce/4 >> Enum.zip_all_reduce/5 >> >> I had some ideas for how to implement this and could work on a PR if the >> proposal is accepted. >> >> 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 [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/6942c6f2-3feb-43c9-9650-e552466c6722n%40googlegroups.com.
