Memoized iterator snapshot (source code)

= Memoized iterator snapshot

Represent a generated <sequence> by shared memoized <lazy list> cells and let each iterator hold its own current cell reference. Copy that reference into a new iterator object. Advancing one cursor changes no other cursor, while every cell's future tail is generated once. Thus even a privately stateful generator can supply identical future values to independently consumed snapshots, provided its state is owned by this shared sequence and not mutated externally. Retained older cursors can keep cached prefixes alive. <Scala 2.12 Stream API documentation>[Opening description and memoization example]{ref}