On Tue, Sep 27, 2011 at 3:39 AM, Jörg F. Wittenberger
<address@hidden> wrote:
I found theses definitions in the irregex code mirroring srfi-1
simplified cases.
(define (filter pred ls)
(let lp ((ls ls) (res '()))
(if (null? ls)
(reverse res)
(lp (cdr ls) (if (pred (car ls)) (cons (car ls) res) res)))))
(define (remove pred ls)
(let lp ((ls ls) (res '()))
(if (null? ls)
(reverse res)
(lp (cdr ls) (if (pred (car ls)) res (cons (car ls) res))))))
The irregex code itself appears not to use them anywhere.
Irregex is designed so that (load "irregex.scm") will work
in any vaguely Scheme-like system. In the near future I
plan on switching to the R7RS module system, but in the
meantime I have no interest in breaking that simplicity.