Lazy CollectionsRelease name: Lazy Collections
Release summary: Alternate calls to select:, reject:, and collect: for collections that doesn't create intermediate collections. It only creates the collection when needed.
Automatic version: 1
Manual version: 13-alpha
Published by: Blaine Buxton (btb)
Created: 12 October 2004 2:28:14 am
Last updated: 12 October 2004 2:28:14 am
- MIT - The MIT license is like BSD without the advertising clause. As free as it gets, suitable for cross Smalltalk 100% reuse. The recommended license for Squeak since the 4.0 release.
- Squeak3.7 - Released 15 Sept 2004.
- Only extensions, no changes - Code extensions but no changes in existing code.
- Development tools - Add-on development tools for Squeak.
- Alpha - Useable by daredevils. Probably still full of bugs.
The idea for LazyCollection is very simple. It takes a functional
approach to the common collection protocol of select:, collect:, and
reject:. By functional, I mean the collection is not changed nor is a new
one created. The blocks are kept around until they are absolutely
needed. I have been wanting this functionality for some time because
it's nice for large collections. If you have a collection in which you are
calling a lot selects, rejects, or collects on, then this will not create
the intermediate collections. It will wait until you ask something of the
collection where it can not delay the answer. This should make these
chained operations must faster on large collections.
This was a lot of fun to program and it's not that big. Take whatever
you want from it!
For examples, see the LazyCollectionTesttest.
To use, simply append lazy to select:, collect:, and reject: selectors.
SHA checksum: 1218356704829231506257683556189580829942027584432