Double-linked lists - Factor Documentation (original) (raw)
A double-linked list is the canonical implementation of a deque.
Double-linked lists form a class:
Constructing a double-linked list:
Double-linked lists support all the operations of the deque protocol (Deques) as well as the following.
dlist-each ( ... dlist quot: ( ... value -- ... ) -- ... )
dlist-find ( ... dlist quot: ( ... value -- ... ? ) -- ... obj/f ? )
dlist-filter ( ... dlist quot: ( ... value -- ... ? ) -- ... dlist' )
dlist-any? ( ... dlist quot: ( ... value -- ... ? ) -- ... ? )
Deleting a node matching a predicate:
delete-node-if* ( ... dlist quot: ( ... value -- ... ? ) -- ... obj/f ? )
delete-node-if ( ... dlist quot: ( ... value -- ... ? ) -- ... obj/f )