From https://ask.clojure.org/index.php/9152/improve-error-messages-for-clojure-core-case
The error message generated when case encounters a non-matching clause uses str, resulting in nil being rendered as an empty string, and strings without quote marks.
For example:
And the potentially confusing
Proposed: Use pr-str for the value resulting in nil and "1" respectively
Note: a similar issue was raised for Clojurescript here:
https://ask.clojure.org/index.php/6575/improve-error-messages-using-instead-when-printing-objects
Patch: clj-2564-3.patch
Patch updated per Rich's comments. After results for the cases above:
Given that we are matching compile-time constant values here, I do this pr-str would be clearer in these error messages.
Can we please look into lifting this error case (throw and printing) into a fn call? That will remove exception handling from case block.
Added alternate clj-2564-2.patch re Rich's comment for consideration.
Released in 1.10.2-alpha2