From 4fd3c882e5dbe905711d4aaf8f0e4fe52369cef7 Mon Sep 17 00:00:00 2001 From: Ivar Refsdal Date: Thu, 30 Jun 2022 09:52:49 +0200 Subject: Release 0.2.58 Document limitations, alternatives. Improve pr-str usage --- src/com/github/ivarref/yoltq/impl.clj | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src/com/github/ivarref/yoltq/impl.clj') diff --git a/src/com/github/ivarref/yoltq/impl.clj b/src/com/github/ivarref/yoltq/impl.clj index 6b14ffc..c37b0e6 100644 --- a/src/com/github/ivarref/yoltq/impl.clj +++ b/src/com/github/ivarref/yoltq/impl.clj @@ -23,11 +23,19 @@ #:db{:ident :com.github.ivarref.yoltq/error-time, :cardinality :db.cardinality/one, :valueType :db.type/long} #:db{:ident :com.github.ivarref.yoltq/version, :cardinality :db.cardinality/one, :valueType :db.type/string, :index true}]) +(defn pr-str-inner [x] + (binding [*print-dup* false + *print-meta* false + *print-readably* true + *print-length* nil + *print-level* nil + *print-namespace-maps* false] + (pr-str x))) (defn pr-str-safe [what x] (try - (if (= x (edn/read-string (pr-str x))) - (pr-str x) + (if (= x (edn/read-string (pr-str-inner x))) + (pr-str-inner x) (throw (ex-info (str "Could not read-string " what) {:input x}))) (catch Exception e (log/error "could not read-string" what ":" (ex-message e)) -- cgit v1.2.3