|
|
|
|
|
by hakunin
523 days ago
|
|
Lazy enumeration can also save memory, because you aren’t storing entire collections during intermediate steps, and it works with infinite/unknown size collections. Such as streaming data. Some examples: I wrote a utility gem a while ago that lets you lazily intersect, union, etc various potentially infinite streams of data. https://github.com/maxim/enum_utils/ I also used lazy enumeration for traversing the wordmap in my no-RAM static storage gem. https://github.com/maxim/wordmap/ |
|