Ordered collections printed as if they were unordered at the REPL
Description fields
Description
This is due to cljs.repl's read-then-print processing of string representations of return values that come back from the JS env. As of release 2371, the relevant code fragment lives here:
This issue seems to be the most likely cause of the problem described in this StackOverflow question. It would be nice to print ordered collections in the "expected" way to prevent user confusion.
This is due to
cljs.repl
's read-then-print processing of string representations of return values that come back from the JS env. As of release 2371, the relevant code fragment lives here:https://github.com/clojure/clojurescript/blob/r2371/src/clj/cljs/repl.clj#L156
A larger snippet to demonstrate this:
ClojureScript:cljs.user> (array-map 1 2 3 4 5 6 7 8 9 10 11 12 13 14) {1 2, 3 4, 5 6, 7 8, 9 10, 11 12, 13 14} ClojureScript:cljs.user> (array-map 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18) {7 8, 1 2, 15 16, 13 14, 17 18, 3 4, 11 12, 9 10, 5 6} ClojureScript:cljs.user> (seq (array-map 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18)) ([1 2] [3 4] [5 6] [7 8] [9 10] [11 12] [13 14] [15 16] [17 18]) ClojureScript:cljs.user> (hash-map 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18) {7 8, 1 2, 15 16, 13 14, 17 18, 3 4, 11 12, 9 10, 5 6}
This issue seems to be the most likely cause of the problem described in this StackOverflow question. It would be nice to print ordered collections in the "expected" way to prevent user confusion.