Welcome! Please see the About page for a little more info on how this works.

0 votes
in Spec by
The spec generator associated with {{inst?}} may produce instants that are technically valid but cannot be read back (and also are not practical in reality).


(require '[clojure.spec.alpha :as s])

(second (last (s/exercise inst? 100)))
;; => #inst "883641-02-19T16:17:26.482-00:00"

#inst "883641-02-19T16:17:26.482-00:00"
;; => RuntimeException Unrecognized date/time syntax: 883641-02-19T16:17:26.482-00:00  clojure.instant/fn--7987/fn--7988 (instant.clj:107)


Minor issue, but I ran into this while interacting with inst generator/generated values in the REPL.

3 Answers

0 votes
by
_Comment made by: glts_

This problem gets worse when the inst generated is in the BC era. In that case, not even can the inst potentially not be read back, but since there is no indication of the ‘negative year’, information is lost.
0 votes
by

Comment made by: souenzzo

There is some info about the limits of reader/printer in CLJ-2486
I catch this problem because I'm generating data and pr-str / read-string over the wire.

0 votes
by
Reference: https://clojure.atlassian.net/browse/CLJ-2347 (reported by glts)
...