ClojureScript

re-seq does not terminate in some cases

Details

  • Type: Defect Defect
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Completed
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
  • Environment:
    Clojurescript 1913

Description

re-matches behaves as expected:

;; clojure:
(re-matches #"\s*" "") ;; ""

;; clojurescript:
(re-matches #"\s*" "") ;; ""

re-seq does not:

;; clojure:
(re-seq #"\s*" "") ;; ("")

;; clojurescript:
(re-seq #"\s*" "") ;; infinite sequence of ""

Activity

Hide
Travis Thieman added a comment -

Patch: 20131017

Always allow one pass through the string, but terminate the lazy sequence if the end of the string is reached after the first match.

Show
Travis Thieman added a comment - Patch: 20131017 Always allow one pass through the string, but terminate the lazy sequence if the end of the string is reached after the first match.
Hide
David Nolen added a comment -

We should have a test in the patch, thanks!

Show
David Nolen added a comment - We should have a test in the patch, thanks!
Hide
Travis Thieman added a comment -

Patch revised with test added

Show
Travis Thieman added a comment - Patch revised with test added

People

Vote (0)
Watch (2)

Dates

  • Created:
    Updated:
    Resolved: