filter! ( ... seq quot: ( ... elt -- ... ? ) -- ... seq )
Factor handbook > The language > Collections > Sequence operations > Destructive sequence operations

Prev:delete-all ( seq -- )
Next:suffix! ( seq elt -- seq )


Vocabulary
sequences

Inputs and outputs
seqa resizable mutable sequence
quota quotation with stack effect ( ... elt -- ... ? )


Word description
Applies the quotation to each element in turn, and removes elements for which the quotation outputs a false value.

Side effects
Modifies seq

See also
filter, filter-as, reject, reject-as, reject!, sift, harvest

Definition


: filter! ( ... seq quot: ( ... elt -- ... ? ) -- ... seq )
swap [ [ 0 0 ] dip (filter!) ] keep ; inline