chickadee » srfi-127 » lseq-filter

lseq-filter pred lseqprocedure
lseq-remove pred lseqprocedure

The procedure lseq-filter lazily returns an lseq that contains only the elements of lseq that satisfy pred.

The procedure lseq-remove is the same as lseq-filter, except that it returns elements that do not satisfy pred. These procedures are guaranteed to call pred on the elements of the lseqs in sequence order.

(lseq-filter odd? (generator->lseq (make-range-generator 1 5)))
 ;=>  (1 3)

(lseq-remove odd? (generator->lseq (make-range-generator 1 5)))
 ;=>  (2 4)