sequences.extras: adding map-sift and map-harvest.
parent
9bc6e29506
commit
a976e31f39
|
@ -133,3 +133,9 @@ IN: sequences.extras
|
|||
|
||||
: map-filter ( ... seq quot: ( ... elt -- ... newelt ) quot: ( ... newelt -- ... ? ) -- ... subseq )
|
||||
pick map-filter-as ; inline
|
||||
|
||||
: map-sift ( ... seq quot: ( ... elt -- ... newelt ) -- ... newseq )
|
||||
[ ] map-filter ; inline
|
||||
|
||||
: map-harvest ( ... seq quot: ( ... elt -- ... newelt ) -- ... newseq )
|
||||
[ empty? not ] map-filter ; inline
|
||||
|
|
Loading…
Reference in New Issue