Handbook
Glossary
deep-map! ( ... obj quot: ( ... elt -- ... elt' ) -- ... obj )
Factor handbook
»
The language
»
Collections
»
Sequence operations
»
Deep sequence combinators
Prev:
deep-any? ( ... obj quot: ( ... elt -- ... ? ) -- ... ? )
Next:
flatten ( obj -- seq )
Vocabulary
sequences
.
deep
Inputs
obj
an
object
quot
a
quotation
with stack effect
( ... elt -- ... elt' )
Outputs
obj
an
object
Word description
Modifies each sub-node of an object in place, in preorder, and returns that object.
See also
map!
Definition
USING:
kernel
sequences
;
IN:
sequences.deep
:
deep-map!
( ... obj quot: ( ... elt -- ... elt' ) -- ... obj )
over
branch?
[
[
[
call
]
keep
over
[
deep-map!
drop
]
dip
]
curry
map!
]
[
drop
]
if
;
inline
recursive