Handbook
Glossary
Persistent sequence protocol
The persistent sequence protocol consists of the non-mutating sequence protocol words, such as
length
and
nth
, together with the following operations:
new-nth
( val i seq -- seq' )
ppush
( val seq -- seq' )
ppop
( seq -- seq' )
The default implementations of the above run in
O(n)
time; the
persistent
.
vectors
vocabulary provides an implementation of these operations in
O(1)
time.