[CLJ-1074] Read/print round-trip for +/-Infinity and NaN Created: 21/Sep/12 Updated: 03/Dec/12
|Affects Version/s:||Release 1.4|
|Patch:||Code and Test|
A few float-related forms (namely, Double/POSITIVE_INFINITY, Double/NEGATIVE_INFINITY, Double/NaN) are not eval-able after a round-trip via
The two options I see are to provide print-method implementations for these and their Float cousins, or to make Infinity, -Infinity, +Infinity, and NaN readable values. Since it sounds like edn may want to provide a spec for these values (see https://groups.google.com/d/topic/clojure-dev/LeJpOhHxESs/discussion and https://github.com/edn-format/edn/issues/2), I think making these values directly readable as already printed is preferable. Something like Double/POSITIVE_INFINITY seems too low-level from edn's perspective, as it would refer to a Java class and constant.
I'm attaching a patch implementing reader support for Infinity, -Infinity, +Infinity, and NaN.
|Comment by Timothy Baldridge [ 03/Dec/12 11:34 AM ]|
Please bring this up on clojure-dev. We'll be able to vet this ticket after that.
|Comment by Colin Jones [ 03/Dec/12 1:18 PM ]|
Should I respond to my original clojure-dev post about this (linked in the issue description above), or start a new one?