So languages clearly favor filter.
- Ruby has filter, too, and I think the name "filter" comes in handy when you want to do a filter+map in one operation: filter_map. - Rust's retain does not operate on an Iterator, but is a special in-place "filter" for Vec-tors, similar to Ruby's keep_if. - Haskell and Ocaml both use filter, too. - C#: List.FindAll or LINQ ("SQL"): where clause. - Go: Seems to have no built-in functionality for "filter". Libraries tend to prefer "Filter" as name. Rob Pike actually has a library called filter (https://pkg.go.dev/robpike.io/filter) that uses Choose. IMHO, good name :) On Sun, Feb 4, 2024 at 3:40 AM Austin Ziegler <halosta...@gmail.com> wrote: > On Sat, Feb 3, 2024 at 8:58 PM Michael Neumann <michaelne...@gmail.com> > wrote: > >> IMHO, filter is a bad naming for what it does when coupled with >> booleans. If the filter condition would return either :keep or :pass, it >> would be obvious. >> > > Regardless of your opinion on the name for this concept (I have no strong > feeling either way), the ship has sailed for most languages. > RosettaCode's page for this is called…Filter: > https://rosettacode.org/wiki/Filter > > There are various names for this: > > - remove-if-not (Common Lisp) > - filter (Clojure) > - seq-filter (Elisp) > - lists:filter (Erlang) > - List.filter (F#) > - Array.prototype.filter (JS) > - select (jq) > - filter (Kotlin) > - grep (Perl) > - findall (Prolog) > - filter (Python, but list comprehensions are more idiomatic) > - select (Ruby) > - filter or retain (Rust) > > The most *common* name that I saw in the entries was filter or some > variation. > > -a > -- > Austin Ziegler • halosta...@gmail.com • aus...@halostatue.ca > http://www.halostatue.ca/ • http://twitter.com/halostatue > > -- > 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 elixir-lang-core+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/elixir-lang-core/CAJ4ekQsTxs-4ZkX%3D0CJ0%2B2UnNzCRNcNoypL2WYP2ySDLnf5-Ow%40mail.gmail.com > <https://groups.google.com/d/msgid/elixir-lang-core/CAJ4ekQsTxs-4ZkX%3D0CJ0%2B2UnNzCRNcNoypL2WYP2ySDLnf5-Ow%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 elixir-lang-core+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/CAKjimWKmj7gPCvRtUmQ3im_zbF3CsBciWWAohkgMaR6YH_0f9Q%40mail.gmail.com.