Classes | Streams-Patterns-Events > Patterns > Filter

Preject : FuncFilterPattern : FilterPattern : Pattern : AbstractFunction : Object

Filters a source pattern by rejecting particular values.


Preject filters the source pattern using func. Values for which func returns true will not be returned by Preject.

This is the pattern library's equivalent of Collection: -reject.

Class Methods, pattern)

From superclass: FuncFilterPattern



A Function. The function used to reject values. It should take a single parameter (the next value from pattern), and return a boolean.


The Pattern to be filtered.

Inherited class methods

Instance Methods

Inherited instance methods

Undocumented instance methods




var a, b;
a = Preject({ arg item; item == 1 }, Pseq(#[1, 2, 3],inf));
x = a.asStream;{; });

The message reject returns a Preject when passed to a pattern

var a, b;
a = Pseq(#[1, 2, 3],inf).reject({ arg item; item == 1 });
x = a.asStream;{; });