Defining a meta method fixes it, but the README implies that it shouldn't be required:
Despite this, there are only four functions which really matter: get, assoc, dissoc, and keys. def-map-type is a variant of deftype which, if those four functions are implemented, will look and act like a Clojure map.
(def-map-type LazyMap [m]
(get [_ k default-value]
(if (contains? m k)
(let [v (get m k)]
(if (instance? clojure.lang.Delay v)
@v
v))
default-value))
(assoc [_ k v]
(LazyMap. (assoc m k v)))
(dissoc [_ k]
(LazyMap. (dissoc m k)))
(keys [_]
(keys m)
(meta [_] nil)) ; this makes the readme example work
Potemkin: 0.3.7 Clojure: 1.6.0 Java: 1.7
Having trouble with even the simple example from the README. This is in a fresh repl:
Defining a meta method fixes it, but the README implies that it shouldn't be required: