Created
April 25, 2011 19:47
-
-
Save stuarthalloway/941069 to your computer and use it in GitHub Desktop.
Generic clojure encoding map for rummage
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; needs rummage to use as-set instead of as-collection... | |
(def clojure-encoding-map | |
(assoc enc/all-strings | |
:encode (fn encode | |
([k] (pr-str k)) | |
([k v] | |
[(pr-str k) (pr-str v)])) | |
:decode (fn | |
([k] (read-string k)) | |
([k v] [(read-string k) (read-string v)])))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment