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

0 votes
in Clojure by

In Clojure 1.9 alpha, limited support for Java 8 {{java.time.Instant}} was added, namely by (conditionally) extending the {{Inst}} protocol to that type.

It would be useful to enhance support for {{java.time.Instant}} further by

  • installing a print-method and print-dup for {{java.time.Instant}}
  • providing a {{read-instant}} function for reading {{java.time.Instant}}

This functionality is already provided in Clojure 1.8 today for the types {{java.util.Date}}, {{java.util.Calendar}}, and {{java.sql.Timestamp}}; extending it to {{java.time.Instant}} would be very helpful in environments using Java 8.

3 Answers

0 votes
by

Comment made by: gshayban

If we make Instants print as #inst like java.util.Date, it could change roundtripping (a read #inst is by default a j.u.Date)

This would be nice when Java 8 is soon baseline for Clojure.

0 votes
by

Comment made by: wcohen

CLJ-2224-p1.patch adds a print-method, print-dup, and read-instant-instant for java.time.Instant.

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