Sync housekeeping
This commit is contained in:
parent
e07ec91f41
commit
a8faac734c
3 changed files with 20 additions and 18 deletions
|
|
@ -15,7 +15,7 @@
|
|||
:dependencies
|
||||
[[org.clojure/clojure "1.5.1"]
|
||||
[org.clojure/tools.reader "0.10.0"]
|
||||
[com.taoensso/encore "2.64.1"]
|
||||
[com.taoensso/encore "2.67.1"]
|
||||
[org.iq80.snappy/snappy "0.4"]
|
||||
[org.tukaani/xz "1.5"]
|
||||
[net.jpountz.lz4/lz4 "1.3"]]
|
||||
|
|
|
|||
|
|
@ -20,8 +20,8 @@
|
|||
LazySeq IRecord ISeq]))
|
||||
|
||||
(if (vector? enc/encore-version)
|
||||
(enc/assert-min-encore-version [2 52 1])
|
||||
(enc/assert-min-encore-version 2.52))
|
||||
(enc/assert-min-encore-version [2 67 1])
|
||||
(enc/assert-min-encore-version 2.67))
|
||||
|
||||
(comment
|
||||
(set! *unchecked-math* :warn-on-boxed)
|
||||
|
|
@ -238,9 +238,9 @@
|
|||
|
||||
;; TODO Switch to thread-local proxies?
|
||||
|
||||
(enc/defonce* ^:dynamic *freeze-fallback* "(fn [data-output x]), nil => default" nil)
|
||||
(enc/defonce* ^:dynamic *custom-readers* "{<hash-or-byte-id> (fn [data-input])}" nil)
|
||||
(enc/defonce* ^:dynamic *auto-freeze-compressor*
|
||||
(enc/defonce ^:dynamic *freeze-fallback* "(fn [data-output x]), nil => default" nil)
|
||||
(enc/defonce ^:dynamic *custom-readers* "{<hash-or-byte-id> (fn [data-input])}" nil)
|
||||
(enc/defonce ^:dynamic *auto-freeze-compressor*
|
||||
"(fn [byte-array])->compressor used by `(freeze <x> {:compressor :auto}),
|
||||
nil => default"
|
||||
nil)
|
||||
|
|
@ -1553,5 +1553,6 @@
|
|||
|
||||
;;;; Deprecated
|
||||
|
||||
(enc/defonce* ^:dynamic *final-freeze-fallback* "DEPRECATED" nil)
|
||||
(def freeze-fallback-as-str "DEPRECATED" write-unfreezable)
|
||||
(enc/deprecated
|
||||
(enc/defonce ^:dynamic *final-freeze-fallback* "DEPRECATED" nil)
|
||||
(def freeze-fallback-as-str "DEPRECATED" write-unfreezable))
|
||||
|
|
|
|||
|
|
@ -8,7 +8,8 @@
|
|||
;; Unfortunately the only ~reliable way we can tell if something's
|
||||
;; really serializable/readable is to actually try a full roundtrip.
|
||||
|
||||
(defn- memoize-type-test [test-fn]
|
||||
(let [swap-cache! @#'enc/-swap-cache!] ; TODO Public with newer Encore
|
||||
(defn- memoize-type-test [test-fn]
|
||||
(let [cache (atom {})] ; {<type> <type-okay?>}
|
||||
(fn [x]
|
||||
(let [t (type x)
|
||||
|
|
@ -16,8 +17,8 @@
|
|||
cacheable? (not (re-find #"__\d+" (str t))) ; gensym form
|
||||
test (fn [] (try (test-fn x) (catch Exception _ false)))]
|
||||
(if cacheable?
|
||||
@(enc/swap-val! cache t #(if % % (delay (test))))
|
||||
(test))))))
|
||||
@(swap-cache! cache t #(if % % (delay (test))))
|
||||
(test)))))))
|
||||
|
||||
(def readable? (memoize-type-test (fn [x] (-> x enc/pr-edn enc/read-edn) true)))
|
||||
(def serializable?
|
||||
|
|
|
|||
Loading…
Reference in a new issue