ztellman / bizarro-collections

you got your clojure semantics in my mutable hash-map

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Clojure and Java maps don't only differ in terms of mutability, they also have different equality semantics:

> (assoc {} 1 2, 1N 3)
{1 3}
> (doto (java.util.HashMap.) (.put 1 2) (.put 1N 3))
{1 2, 1N 3}

This library provides a mutable hash-map that behaves like a normal java.util.HashMap, but has Clojure's equality semantics:

> (doto (bizarro-collections/hash-map) (.put 1 2) (.put 1N 3))
{1 3}

usage

Add this to your project.clj:

[bizarro-collections "0.1.0"]

license

Copyright © 2014 Zach Tellman

Distributed under the GPL v2

About

you got your clojure semantics in my mutable hash-map


Languages

Language:Java 98.2%Language:Clojure 1.8%