We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When using sequence with transducers, transit/write failes with an exception.
sequence
transit/write
Consider:
(def transit-writer (transit/writer :json)) (defn transform-map [m] (assoc m :x 1)) (def data [{:a 1} {:a 1}]) (prn "p1. Regular map") (prn (transit/write transit-writer (map transform-map data))) (prn "p2. Transducer") (prn (transit/write transit-writer (sequence (map transform-map) data))) (prn "p3. Done")
Regular map (p1) will print just fine, however, p2 fails with an exception:
Uncaught Error: Cannot write writer.maybeQuoted @ writer.js:464 writer.marshalTop @ writer.js:471 writer.Writer.write @ writer.js:501 cognitect$transit$write @ transit.cljs?rel=1478250205512:256 (anonymous function) @ core.cljs?rel=1478251095137:53
Because of that, obviously p3 never gets printed.
Latest transit: 0.8.239. I'm able to reproduce it on ClojureScript 1.9.293 (latest) as well as 1.9.76 (haven't tried other versions).
The text was updated successfully, but these errors were encountered:
For completness:
;; Breaks too. (prn (transit/write transit-writer (doall (sequence (map transform-map) data)))) ;; Works fine. (prn (transit/write transit-writer (vec (sequence (map transform-map) data)))) ;; Works fine. (prn (transit/write transit-writer (apply list (sequence (map transform-map) data))))
Sorry, something went wrong.
I can't replicate this with the latest ClojureScript
No branches or pull requests
When using
sequence
with transducers,transit/write
failes with an exception.Consider:
Regular map (p1) will print just fine, however, p2 fails with an exception:
Because of that, obviously p3 never gets printed.
Latest transit: 0.8.239. I'm able to reproduce it on ClojureScript 1.9.293 (latest) as well as 1.9.76 (haven't tried other versions).
The text was updated successfully, but these errors were encountered: