Welcome! Please see the About page for a little more info on how this works.

0 votes
in ClojureScript by

clojure/core.rrb-vector implements the MapEntry protocol in clojurescript, which seems to cause incorrect results when passed to (vec ...) (which, checks if the input is a MapEntry as its first case).

(vec (range 10))
[0 1 2 3 4 5 6 7 8 9]

>(rrb/vec (range 10))
[0 1 2 3 4 5 6 7 8 9]

(vec (rrb/vec (range 10)))
[0 1] <------- !!!!!!!!!

(seq (rrb/vec (range 10)))
(0 1 2 3 4 5 6 7 8 9)

(map-entry? (rrb/vec (range 10)))
true <------- !!!!!!!!!

(map-entry? (vec (range 10)))
false

1 Answer

+1 vote
by

I can confirm that I also see this behavior with the ClojureScript version of the core.rrb-vector library. I have made some bug fixes to that library recently, and did not notice this. The library's original author added the implementation for the IMapEntry protocol, but I do not know the reason why. I can look into it a bit more. Thanks for the report.

...