RANGE-FILTER

[GENERIC-FUNCTION]


OM 6.1
Function Reference
ARGUMENTS:
  - list a list [default = (1 2 3 4 5)]
  - posn position bounds [default = ((0 1) (3 4))]
  - mode pass or reject [default = reject]

Description:

Select elements in <list> whose positions (couting from 0) in the list are defined by <posn>
<posn> is a list of pairs (min-pos max-pos) in increasing order with no everlap.

<mode> 'reject' means reject the selected elements.
<mode> 'pass' means retain only the selected elements.

Ex. (range-filter '(10 11 12 13 14 15 16) '((0 1) (3 4)) 'pass) => (10 11 13 14)
Ex. (range-filter '(10 11 12 13 14 15 16) '((0 1) (3 4)) 'reject) => (12 13)