~ chicken-core (chicken-5) b12797524beaaf27023fea905adf44394448e515
commit b12797524beaaf27023fea905adf44394448e515 Author: felix <felix@call-with-current-continuation.org> AuthorDate: Wed Jul 28 15:13:46 2010 +0200 Commit: felix <felix@call-with-current-continuation.org> CommitDate: Wed Jul 28 15:13:46 2010 +0200 some bugfixes diff --git a/chicken-status.scm b/chicken-status.scm index cf03ce3c..cbd246c3 100644 --- a/chicken-status.scm +++ b/chicken-status.scm @@ -125,7 +125,7 @@ EOF (lambda () (let* ((patterns (map - regexp + irregex (cond ((null? pats) '(".*")) (exact (map (lambda (p) (string-append "^" (irregex-quote p) "$")) diff --git a/irregex-core.scm b/irregex-core.scm index 4f5f410c..970981d7 100644 --- a/irregex-core.scm +++ b/irregex-core.scm @@ -31,6 +31,8 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;; History ;; +;; 0.8.1.1: 2010/07/28 (felix): added CHICKEN-specific hacks, conditionally +;; compiled using `cond-expand' ;; 0.8.1: 2010/03/09 - backtracking irregex-match fix and other small fixes ;; 0.8.0: 2010/01/20 - optimizing DFA compilation, adding SRE escapes ;; inside PCREs, adding utility SREs @@ -478,14 +480,16 @@ ;; SRFI-1 extracts (simplified 1-ary versions) (define (find pred ls) - (cond ((find-tail pred ls) => car) - (else #f))) + (let lp ((ls ls)) + (cond ((null? ls) #f) + ((pred (car ls)) (car ls)) + (else (lp (cdr ls)))))) (define (find-tail pred ls) (let lp ((ls ls)) (cond ((null? ls) #f) - ((pred (car ls)) ls) - (else (lp (cdr ls)))))) + ((pred (car ls)) ls) + (else (lp (cdr ls)))))) (define (last ls) (if (not (pair? ls)) diff --git a/irregex.scm b/irregex.scm index 655d5554..14c071a8 100644 --- a/irregex.scm +++ b/irregex.scm @@ -166,4 +166,4 @@ (else (loop2 (cdr rest) (cons (car rest) s)))))) (else (cons c (loop rest (memq c '(#\\ #\/)))))))))))) - (if sre? sre (regexp sre)))))) + (if sre? sre (irregex sre))))))Trap