reject! ( ... seq quot: ( ... elt -- ... ? ) -- ... seq )


Vocabulary
sequences

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


Outputs
seqa resizable mutable sequence.


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

Notes
The sequence seq MUST be growable. See Resizable sequence implementation.

Side effects
Modifies seq

Examples
Remove the odd numbers
USING: math prettyprint sequences ; V{ 1 2 3 4 5 6 7 8 9 0 } [ odd? ] reject! .
V{ 2 4 6 8 0 }


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

Definition


: reject! ( ... seq quot: ( ... elt -- ... ? ) -- ... seq )
negate filter! ; inline