Virtual sequences
Factor handbook > The language > Collections

Prev:Sequence operations
Next:Making sequences with variables


A virtual sequence is an implementation of the Sequence protocol which does not store its own elements, and instead computes them, either from scratch or by retrieving them from another sequence.

Implementations include the following:
reversed

slice


Virtual sequences can be implemented with the Virtual sequence protocol, by translating an index in the virtual sequence into an index in another sequence.

See also
Counted loops