Added support for namespaced keywords.

This commit is contained in:
Peter Taoussanis 2012-07-08 13:00:34 +07:00
parent 8f9bce289b
commit cddd2eef13
2 changed files with 5 additions and 1 deletions

View file

@ -60,6 +60,7 @@ nippy/stress-data
:string-utf8 "ಬಾ ಇಲ್ಲಿ ಸಂಭವಿಸ" :string-utf8 "ಬಾ ಇಲ್ಲಿ ಸಂಭವಿಸ"
:string-long (apply str (range 1000)) :string-long (apply str (range 1000))
:keyword :keyword :keyword :keyword
:ns-keyword ::keyword
:list (list 1 2 3 4 5 (list 6 7 8 (list 9 10))) :list (list 1 2 3 4 5 (list 6 7 8 (list 9 10)))
:list-quoted '(1 2 3 4 5 (6 7 8 (9 10))) :list-quoted '(1 2 3 4 5 (6 7 8 (9 10)))

View file

@ -100,7 +100,9 @@
(freezer Character id-char (.writeChar s (int x))) (freezer Character id-char (.writeChar s (int x)))
(freezer String id-string (.writeUTF s x)) (freezer String id-string (.writeUTF s x))
(freezer Keyword id-keyword (.writeUTF s (name x))) (freezer Keyword id-keyword (.writeUTF s (if-let [ns (namespace x)]
(str ns "/" (name x))
(name x))))
(declare freeze-to-stream!*) (declare freeze-to-stream!*)
@ -252,6 +254,7 @@
:string-utf8 "ಬಾ ಇಲ್ಲಿ ಸಂಭವಿಸ" :string-utf8 "ಬಾ ಇಲ್ಲಿ ಸಂಭವಿಸ"
:string-long (apply str (range 1000)) :string-long (apply str (range 1000))
:keyword :keyword :keyword :keyword
:ns-keyword ::keyword
:list (list 1 2 3 4 5 (list 6 7 8 (list 9 10))) :list (list 1 2 3 4 5 (list 6 7 8 (list 9 10)))
:list-quoted '(1 2 3 4 5 (6 7 8 (9 10))) :list-quoted '(1 2 3 4 5 (6 7 8 (9 10)))