clojure.core/=¶
Equality. Returns true if x equals y, false if not. Same as Java x.equals(y) except it also works for nil, and compares numbers and collections in a type-independent manner. Clojure's immutable data structures define equals() (and thus =) as a value, not an identity, comparison.
Examples¶
Note by gstamp¶
There is a difference between "=" and "". For primitives you definitely want to use "" as "=" will result in a cast to the wrapped types for it's arguments.
This may not be the case come Clojure 1.3 (see [1])
[1] http://github.com/clojure/clojure/commit/df8c65a286e90e93972bb69392bc106128427dde
Note by domokato¶
= compares collections in a type-independent manner but not numbers, despite what the docs say. See examples above.
See also¶
- clojure.core/== (5)
- clojure.core/not= (3)
- clojure.core/identical? (3)
Content from the matching ClojureDocs page, with authors credited on each contribution.