Commits

w01fe committed 71073db

Fix bug where .entryAt returns entry when none present, and add error-checking to quote-values.

Comments (0)

Files changed (1)

src/main/clojure/lazymap/core.clj

   (without     [this k] (create-lazy-map (dissoc base k) metadata))
   ; Associative
   (containsKey [this k] (contains? base k))
-  (entryAt     [this k] (LazyMapEntry. k (base k)))
+  (entryAt     [this k] (when-let [v (base k)] (LazyMapEntry. k v)))
   ; IPersistentCollection
   (count       [this]   (count base))
   (cons
 
 (defn- quote-values
   [kvs]
+  (assert (even? (count kvs)))
   (mapcat (fn [[k v]] [k `(delay ~v)]) (partition 2 kvs)))
 
 (defn lazy-assoc*