<< Back to previous view

[DJSON-4] Please make function write-string public Created: 22/Oct/12  Updated: 27/Oct/12  Resolved: 27/Oct/12

Status: Closed
Project: data.json
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Enhancement Priority: Minor
Reporter: Jan Herich Assignee: Unassigned
Resolution: Completed Votes: 0
Labels: enhancement


 Description   

Please make function write-string in namespace clojure.data.json public, instead of private as it is now: for example, i'm extending java.sql.Timestamp with JSONWriter protocol and i need to send ISO formatted timestamp value as string:

(defn- write-timestamp [Timestamp out]
(write-string (convert-to-iso-time (.getTime Timestamp)) out))

(extend java.sql.Timestamp js/JSONWriter {:-write write-timestamp})



 Comments   
Comment by Stuart Sierra [ 27/Oct/12 1:12 PM ]

Declined. 'write-string' is an implementation detail, not something I will commit to as a public API. Use the :value-fn option of 'write' to handle extension to new types. Or copy the implementation of 'write-string' into your namespace.

Generated at Wed Nov 26 07:02:29 CST 2014 using JIRA 4.4#649-r158309.