Uploaded image for project: 'ClojureScript'
  1. CLJS-3007

clojure.string/split on empty regex includes empty string in results

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects versions: None
    • Fix versions: None
    • Labels:
      None

      Description

      In ClojureScript (clojure.string/split "abc" #"") yields ["" "a" "b" "c"] while in Clojure it yields ["a" "b" "c"]

      It might be the case that this was done in https://github.com/clojure/clojurescript/commit/bf22dcca2e858811c8553ca9037e34a05b642121 to specifically match the behavior of an older version of Java (See CLJ-1312 Closed ).

      Given that Clojure / Java now produces a different behavior, if the only rationale for this was to make it match Clojure, then perhaps ClojureScript should also change? (If nothing else, for alignment with Clojure).

      (I have no good answer regarding the fact that this would be a breaking change, but logging a ticket here for discussion regardless.)

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              mfikes Mike Fikes
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated: