Last active
October 20, 2017 08:41
-
-
Save Melipone/5723339 to your computer and use it in GitHub Desktop.
Strange hash behavior
This file contains hidden or 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
(import [java.util HashMap]) | |
(def mymap (new HashMap)) | |
(. mymap put (hash "http://www.google.com/") "serp") | |
(def myhash (hash "http://www.google.com/")) | |
myhash | |
;;-87748806 | |
(. mymap get myhash) | |
;;"serp" | |
(spit "mytest.fb" (into {} mymap)) | |
(def mymap2 (java.util.HashMap. (read-string (slurp "mytest.fb")))) | |
(. mymap2 get myhash) | |
;;nil | |
(. mymap2 get -87748806) | |
"serp" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment