4 ms·
It's not the Ruby way, much like it won't be pythonic doing like Ruby does. It won't be as clear in Ruby, hence my initial difficulties with the pythonic form d
by pmontra 10y ago
It's not the Ruby way, much like it won't be pythonic doing like Ruby does. It won't be as clear in Ruby, hence my initial difficulties with the pythonic form despite being similar to the standard mathematical notation.
Ruby has methods, not functions. We call methods of Enumerable to transform list like objects (anything that includes Enumerable) and return another list like object to apply other methods to. And there is also Enumerable::Lazy for some use cases.
Anyway you could open a feature request at https://bugs.ruby-lang.org/issues/ https://bugs.ruby-lang.org/issues/ and see what happens. See the two issues at https://bugs.ruby-lang.org/search?utf8=%E2%9C%93&issues=1&q=List+comprehension+ https://bugs.ruby-lang.org/search?utf8=%E2%9C%93&issues=1&q=... first