#
cp.collect.LazyList
A LazyList is a list that is lazily evaluated. It will dynamically create items on demand, and may cache the results if configured to do so.
It works by requiring two functions which provide information about the length and item at a given index.
The len
function is called when the length of the list is required, and the get
function is called when
an item is required.
This allows the list to be created lazily, and the items to be created on demand. That is useful for lists that are expensive to create, but are only required when they are actually used.
#
API Overview
Constructors - API calls which return an object, typically one that offers API methods
new