Re:Ruby 3.2.0 Is from Another Dimension
by robertlagrant on Wednesday January 04, 2023 @08:38AM
(#34245368)
True, although that seems less readable than the comprehension versions. I might be just biased, though.
The select does two passes, which makes it quite inefficient. One does not even need filter_map, since the example is essentially a reduce operation.
This works in ruby 2.5.1. Probably works in 1.9 and mruby as well.