Hi all, recently I opened I pull request on Elixir repo. Which is:

https://github.com/elixir-lang/elixir/pull/10664

Adding the Enum.every? function on the Enum module.

I had case where, given a list of atoms, all of the needs to return true:

Enum.every?([:some, :some, :some], fn x -> x == :some end)
...> true

Enum.every?([])
...> false

I tried with functions like Enum.all?/2 and Enum.any?/2. But the cases are 
follow:

Enum.all?/2 - Returns true in case of an empty list;
Enum.any?/2 - Returns false, which is correct but if there is a different 
value on the list. Probably this will return true.

So I took the name every because I'm used to use like this on JS. But as 
Valim mentioned on the PR, it could be all_non_empty? or something else.

What do you guys think?

-- 
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/977fcb5e-3d81-4017-b993-7d27a695937an%40googlegroups.com.

Reply via email to