Lazy Collections

Description

The idea for LazyCollection is very simple. It takes a functionalapproach to the common collection protocol of select:, collect:, andreject:. By functional, I mean the collection is not changed nor is a newone created. The blocks are kept around until they are absolutelyneeded. I have been wanting this functionality for some time becauseit's nice for large collections. If you have a collection in which you arecalling a lot selects, rejects, or collects on, then this will not createthe intermediate collections. It will wait until you ask something of thecollection where it can not delay the answer. This should make thesechained operations must faster on large collections.This was a lot of fun to program and it's not that big. Take whateveryou want from it!For examples, see the LazyCollectionTesttest.To use, simply append lazy to select:, collect:, and reject: selectors.

Details

Source
SqueakMap
Dialect
squeak (65% confidence)

Categories

UI / Graphics Testing Education / Howto System / OS
← Back to results