-
Notifications
You must be signed in to change notification settings - Fork 49
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
Different output of tagged literals in library vs shell #318
Comments
I'm sorry that you ran into this. I can reproduce it. I'm not sure yet what is going on, but I have some suspicions. I'll get back to you with more information as soon a I can. |
Thanks for noticing this. The problem is both subtle and glaring. zprint handles tagged-literals when formatting source, as the parser for source sees them as a reader-macro and there is code to handle some minor variations of them there. However, when formatting actual Clojure structures, zprint doesn't recognize tagged literals. At all. So it just includes the The obvious fix is for zprint to recognize a tagged literal and do the right thing with it. Which is a fix I will make, but until it is released, there is nothing you can do to get rid of the commas. I'll let you know when it is released in this issue. |
I see, thank you for looking into it. Meanwhile, if performance is of no concern, a hacky workaround is to (zp/zprint-str (pr-str [{:a :b :c :d} (tagged-literal 'x {:a :b :c :d})])
{:map {:comma? false} :parse-string? true})
"[{:a :b :c :d} #x {:a :b :c :d}]" |
Good thought, that didn't occur to me. I have fixed it (though yet to finish the tests), it will be in the next release, |
Expected the comma between
:e :f, :g :h
to not be there. Reproduced in cljs and babashka with zprint v1.2.9. Interestingly it prints as expected viabb zprint
The text was updated successfully, but these errors were encountered: