aboutsummaryrefslogtreecommitdiff
path: root/src/clojure/contrib/str_utils.clj
diff options
context:
space:
mode:
authorChouser <chouser@n01se.net>2009-02-17 20:42:30 +0000
committerChouser <chouser@n01se.net>2009-02-17 20:42:30 +0000
commitd5701c377f826266d19e21ce11398616d63f25bb (patch)
treef7212ede149f60323a697e5834b9fa369eb8c73f /src/clojure/contrib/str_utils.clj
parentab67c84237f052fea57d7cbfc45d7908026f46fa (diff)
Merged lazy branch into trunk:
svn merge -r472:477 ../branches/lazy/
Diffstat (limited to 'src/clojure/contrib/str_utils.clj')
-rw-r--r--src/clojure/contrib/str_utils.clj13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/clojure/contrib/str_utils.clj b/src/clojure/contrib/str_utils.clj
index 74a5266e..d24bbb05 100644
--- a/src/clojure/contrib/str_utils.clj
+++ b/src/clojure/contrib/str_utils.clj
@@ -35,12 +35,13 @@
[#^Pattern re string]
(let [m (re-matcher re string)]
((fn step [prevend]
- (if (.find m)
- (lazy-cons (.subSequence string prevend (.start m))
- (lazy-cons (re-groups m)
- (step (+ (.start m) (count (.group m))))))
- (when (< prevend (.length string))
- (list (.subSequence string prevend (.length string))))))
+ (lazy-seq
+ (if (.find m)
+ (cons (.subSequence string prevend (.start m))
+ (cons (re-groups m)
+ (step (+ (.start m) (count (.group m))))))
+ (when (< prevend (.length string))
+ (list (.subSequence string prevend (.length string)))))))
0)))
(defn re-gsub