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.
Travis Thieman made changes -
Field Original Value New Value
Attachment re-seq-20131017.diff [ 12333 ]
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!
Travis Thieman made changes -
Attachment re-seq-20131017.diff [ 12333 ]
Travis Thieman made changes -
Attachment re-seq-20131017.diff [ 12335 ]
Hide
Travis Thieman added a comment -

Patch revised with test added

Show
Travis Thieman added a comment - Patch revised with test added
David Nolen made changes -
Resolution Completed [ 1 ]
Status Open [ 1 ] Resolved [ 5 ]
David Nolen made changes -
Status Resolved [ 5 ] Closed [ 6 ]

People

Vote (0)
Watch (2)

Dates

  • Created:
    Updated:
    Resolved: