Handbook
Glossary
deep-each ( ... obj quot: ( ... elt -- ... ) -- ... )
Factor handbook
»
The language
»
Collections
»
Sequence operations
»
Deep sequence combinators
Next:
deep-map ( ... obj quot: ( ... elt -- ... elt' ) -- ... newobj )
Vocabulary
sequences
.
deep
Inputs
obj
an
object
quot
a
quotation
with stack effect
( ... elt -- ... )
Outputs
None
Word description
Execute a quotation on each nested element of an object and its children, in preorder.
See also
each
Definition
USING:
kernel
sequences
;
IN:
sequences.deep
:
deep-each
( ... obj quot: ( ... elt -- ... ) -- ... )
[
call
]
2keep
over
branch?
[
[
deep-each
]
curry
each
]
[
2drop
]
if
;
inline
recursive