-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
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
map-vals and map-keys don't understand #_uneval-nodes #79
Comments
@doby162 It might be worth checking if https://github.com/lread/rewrite-cljc-playground solves this problem for you. The author @lread is working on this as a merger of rewrite-clj and rewrite-cljs. I've been using it in carve which has been exposed to quite a lot of code and so far I haven't heard anyone complain. |
Thank you, I'll check that out! |
Did I fix this in rewrite-clj v1? I'll check. |
@doby162 it has been a while since you reported this issue, thanks for raising it. I'll try to guess what you were seeing, I'm testing against the main branch of rewrite-clj. Let's start with something that works: (-> "{:a 1 :b 2 :c 3}"
z/of-string
z/sexpr)
;; => {:c 3, :b 2, :a 1} And now we'll introduce some uneval: (-> "{:a 1 #_#_:b 2 :c 3}"
z/of-string
z/sexpr)
;; => {:c 3, :a 1} That works too. But... if we introduce uneval that would create an uneven number of forms in our map, we'll trigger an exception: (-> "{:a 1 #_:b 2 :c 3}"
z/of-string
z/sexpr)
;; ; IllegalArgumentException No value supplied for key: 3 clojure.lang.PersistentHashMap.create (PersistentHashMap.java:77) This is normal rewrite-clj behaviour. It allows this type of illegal map, but because it is not legal Clojure it cannot be sexpr-essed. Is this anything like the error you were encountering? If not, please provide a minimal code example that reproduces the failure you were encountering. |
No response received, assuming we are good, if not can re-open in the future. |
This seems related to #70, but it causes the nodes returned bu map-vals and map-keys to not correctly correspond to the values and keys in a hashmap if the hashmap contains uneval nodes.
The text was updated successfully, but these errors were encountered: