Handbook
Glossary
flatten-as ( obj exemplar -- seq )
Vocabulary
sequences
.
deep
Inputs
obj
an
object
exemplar
a
sequence
Outputs
seq
a
sequence
Word description
Creates a sequence (of the same type as
exemplar
) of all of the leaf nodes (non-sequence nodes, but including strings and numbers) in the object.
Definition
USING:
kernel
;
IN:
sequences.deep
:
flatten-as
( obj exemplar -- seq )
[
branch?
]
swap
deep-reject-as
;