TABLE-FILTER

[GENERIC-FUNCTION]


OM 6.1
Function Reference
ARGUMENTS:
  - test function or function name [default = numberp]
  - list list of lists [default = ((1 2) (1 2))]
  - numcol rank [default = 1]
  - mode pass or reject [default = pass]

Description:

Filters out <list> (a list of lists) using the predicate <test>.

<test> may be a function name (a symbol) or it may be a visual function or patch in 'lambda' mode.

The predicate <test> is applied to the element of rank <numcol> in every sublist in <list> and filters the whome sublists.

<numcol> counts from 0.

<mode> 'reject' means reject elements whose <numcol>th element verifies <test>.
<mode>'pass' means retain only elements whose <numcol>th element verifies <test>.

Ex. (table-filter 'oddp '((1 2 3) (4 5 6) (7 8 9)) 1 'pass) --> ((4 5 6)) [keeps lists which first element is odd]
Ex. (table-filter 'oddp '((1 2 3) (4 5 6) (7 8 9)) 1 'reject) --> ((1 2 3) (7 8 9)) [rejects lists which first element is odd]