Skip to content

Commit

Permalink
Merge pull request #19 from neverfox/pull-request/remove-update
Browse files Browse the repository at this point in the history
Stop conditionally compiling update for Clojure versions before 1.7
  • Loading branch information
aphyr authored Feb 1, 2017
2 parents eb408dd + 46f7e19 commit b7b67df
Showing 1 changed file with 0 additions and 15 deletions.
15 changes: 0 additions & 15 deletions core/src/tesser/utils.clj
Original file line number Diff line number Diff line change
Expand Up @@ -80,21 +80,6 @@
([init coll]
(reductions + init coll)))

(defmacro unless-update [body]
(when (neg? (compare [1 7 0] (mapv (partial get *clojure-version*) [:major :minor :incremental])))
body))

(unless-update
(defn update
"Given a map, a key, a function f, and optional args, returns a copy of map
with that key set to (f current-val arg1 arg2 ...). Like update-in, but only
one level deep."
([m k f] (assoc m k (f (get m k))))
([m k f a] (assoc m k (f (get m k) a)))
([m k f a b] (assoc m k (f (get m k) a b)))
([m k f a b c] (assoc m k (f (get m k) a b c)))
([m k f a b c & args] (assoc m k (apply f (get m k) a b c args)))))

(defn map-vals
"Maps over a key-value map, returning a new map by transforming each value
with (f v)."
Expand Down

0 comments on commit b7b67df

Please sign in to comment.