Closed bakyeono closed 11 years ago
;;;; test about this issue (def before-round (sorted-map 0 "value" 1 "value")) (def after-round (taoensso.nippy/thaw-from-bytes (taoensso.nippy/freeze-to-bytes before-round)))
(class before-round) ; ===> clojure.lang.PersistentTreeMap
(class after-round) ; ===> clojure.lang.PersistentArrayMap
(subseq before-round = 0) ; ===> ([0 "value"])
(subseq after-round = 0) ; ClassCastException clojure.lang.PersistentArrayMap cannot be cast to clojure.lang.Sorted
;;;; an improvised solution for users ; use this function to regain sorted-map (defn hash-map->sorted-map [coll] (into (sorted-map) (sort coll)))
; test (class (hash-map->sorted-map after-round)) ; ===> clojure.lang.PersistentTreeMap
Hi bakyeono,
Sorry for the delay replying - was travelling the past few weeks. Working through a backlog now, will try get back to you in a couple days!
Just pushed 1.2.0 which adds support for sorted maps and sets. Hope that helps! Cheers :-)
Thanks a lot! You're a great man!
Hi~ This lib is very useful but I found a little problem with sorted-map. After the round-trip, sorted-maps are converted into hash-maps. This can be problem to someone depends on sorted-map data structures.