e.lazy â lazy_enumerator
Instance Public methods
Returns a lazy enumerator, whose methods map/collect,
flat_map/collect_concat, select/find_all, reject, grep, zip, take, #take_while, drop, and #drop_while enumerate values
only on an as-needed basis. However, if a block is given to zip, values
are enumerated immediately.
Example
The following program finds pythagorean triples:
def pythagorean_triples
(1..Float::INFINITY).lazy.flat_map {|z|
(1..z).flat_map {|x|
(x..z).s