Skip to content

Instantly share code, notes, and snippets.

@Melipone
Last active October 20, 2017 08:41
Show Gist options
  • Save Melipone/5723339 to your computer and use it in GitHub Desktop.
Save Melipone/5723339 to your computer and use it in GitHub Desktop.
Strange hash behavior
(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