dlist-filter ( ... dlist quot: ( ... value -- ... ? ) -- ... dlist' )
Factor handbook » The language » Collections » Double-linked lists

Prev:dlist-find ( ... dlist quot: ( ... value -- ... ? ) -- ... obj/f ? )
Next:dlist-any? ( ... dlist quot: ( ... value -- ... ? ) -- ... ? )


Vocabulary
dlists

Inputs
dlista dlist
quota quotation


Outputs
dlist'a dlist


Word description
Applies the quotation to each element of the dlist in turn, removing the corresponding nodes if the quotation returns f.

Side effects
Modifies dlist

Definition


: dlist-filter
( ... dlist quot: ( ... value -- ... ? ) -- ... dlist' )
<dlist> [
[ push-back ] curry [ [ keep swap ] curry ] dip
[ [ drop ] if ] curry compose dlist-each
] keep ; inline