I totally agree with Xavier. A qui, 21/01/2021, 13:33, Xavier Noria <[email protected]> escreveu:
> To me, this is like adding an option to any? Let's imagine: any?(enum, > on_empty: true). > > You'd say, man, how can you special-case the enum like that, the predicate > is about finding some element! If there is no element, then, the result > should be false. If you need contextual logic about the emptiness of the > collection, write it next to the predicate. > > Same for all?(enum, on_empty: false). How can all? return false for an > empty collection? It does not make sense! If there are no elements, all? > should be true! It is the same argument argued above for any? It's equally > off for me. > > In my view, if you need logic about the emptiness, you write it apart, do > not mix it. > > -- > 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/CAM%3DYcdi_Hb2%2BwDWgLuC_Dqe7XwgaiuBVzC%2BSXC07wkuGJwy9ZQ%40mail.gmail.com > <https://groups.google.com/d/msgid/elixir-lang-core/CAM%3DYcdi_Hb2%2BwDWgLuC_Dqe7XwgaiuBVzC%2BSXC07wkuGJwy9ZQ%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 [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/CAF7CYk4210%3D5giuTrLXqxCRC6W-u%3D2ERCcsWuzD58-x-S1Gqwg%40mail.gmail.com.
