[CLJ-1275] print-dup's handling of metadata typehint is unreadable in some circumstances Created: 02/Oct/13 Updated: 29/Aug/14
|Affects Version/s:||Release 1.5, Release 1.6|
|Patch:||Code and Test|
With print-dup true, if an object being printed has a metadata map with only a :tag key, the printer renders it as "^value". This can cause an IllegalArgumentException if you try to read the printed string back in, in some circumstances. E.g.
This is causing problems with sleight/riddley's  handling of the (case) macro, which drops a type-hint on a gensym it incorporates in the form it returns. When sleight tries to reserialize a macroexpanded (case) form from riddley, it fails as demonstrated above. E.g.
The attached patch corrects this by making core_print.clj's print-meta always print out the full metadata map if print-dup is true. The patch also contains a test for this case.
|Comment by Alex Coventry [ 02/Oct/13 10:28 PM ]|
Corresponding bug on sleight: https://github.com/ztellman/sleight/issues/5
|Comment by Andy Fingerhut [ 29/Aug/14 4:39 PM ]|
Patch 0001-Don-t-use-shorthand-for-typehints-when-print-dup.patch dated Oct 2 2013 no longer applied cleanly to latest master after some commits were made to Clojure on Aug 29, 2014. It did apply cleanly before that day.
I have not checked how easy or difficult it might be to update this patch.