News for hackers. Stuff that matters.
Re:Ruby 3.0 Preview 1 by EdwardDiego on Friday September 25, 2020 @10:01PM (#24595848)
`where` is intuitive as a synonym for `filter`, but it's the `select` that always threw me as a synonym for `map`.

I get that they're trying to expose an SQL-like API, but yeah, map is always about mutation, but `select`only does mutation sometimes in SQL.

Re:Ruby 3.0 Preview 1 by monadic2 on Saturday September 26, 2020 @02:21AM (#24596817)
Map doesn't mutate, it returns the result of applying a function to the (possibly immutable) value. I believe you can also, say, `select icolumn * 2 from table`, where `icolumn * 2` provides precisely the same functionality as the function passed to a map.
Re:Ruby 3.0 Preview 1 by jen20 on Friday September 25, 2020 @11:53PM (#24596281)
`Where` at least answers the question "does filter _keep_ the things matching the predicate or _remove_ the things matching the predicate" - my pet hate with the .NET naming is `SelectMany` over `flatmap`.