Deep sequence combinators
Factor documentation
>
Factor handbook
>
The language
>
Collections
>
Sequence operations
Prev:
Trimming sequences
Next:
Counted loops
The combinators in the
sequences.deep
vocabulary are variants of standard sequence combinators which traverse nested subsequences.
deep-each
( obj quot: ( elt -- ) -- )
deep-map
( obj quot: ( elt -- elt' ) -- newobj )
deep-filter
( obj quot: ( elt -- ? ) -- seq )
deep-find
( obj quot -- elt )
deep-any?
( obj quot -- ? )
deep-map!
( obj quot: ( elt -- elt' ) -- obj )
A utility word to collapse nested subsequences:
flatten
( obj -- seq )