Handbook
Glossary
filter-map-as ( ... seq filter-quot: ( ..a elt -- ..b ? ) map-quot: ( obj -- obj' ) exemplar -- ... newseq )
Vocabulary
sequences
.
extras
Inputs
seq
a
sequence
filter-quot
an
object
map-quot
an
object
exemplar
an
object
Outputs
newseq
a
sequence
Word description
Filter the given sequence with
filter-quot
, then perform a map on the filtered sequence with
map-quot
. Outputs a sequence of the same class as
exemplar
.
Definition
USING:
kernel
sequences
sequences.extras.private
;
IN:
sequences.extras
:
filter-map-as
( ... seq filter-quot: ( ..a elt -- ..b ? ) map-quot: ( obj -- obj' ) exemplar -- ... newseq )
reach
length
over
[
1filter-mapper-for
[
each
]
dip
]
2curry
dip
like
;
inline