Created
May 9, 2014 22:00
-
-
Save duelinmarkers/7c9f84cfc238e5d37a09 to your computer and use it in GitHub Desktop.
Surprising behavior w/ Clojure vs Java data structures
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
user=> (-> {} (assoc [1 2] "vec") (assoc (java.util.ArrayList. [1 2]) "alist")) | |
{[1 2] "alist"} | |
user=> (-> #{} (conj [1 2]) (conj (java.util.ArrayList. [1 2]))) | |
#{[1 2]} | |
user=> *clojure-version* | |
{:major 1, :minor 5, :incremental 1, :qualifier nil} | |
;;;;;;;;;;;;;;;;;;;;; | |
user> (-> {} (assoc [1 2] "vec") (assoc (java.util.ArrayList. [1 2]) "alist")) | |
{[1 2] "alist"} | |
user> (-> #{} (conj [1 2]) (conj (java.util.ArrayList. [1 2]))) | |
#{[1 2] [1 2]} | |
user> *clojure-version* | |
{:major 1, :minor 6, :incremental 0, :qualifier nil} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment