min (resp. max) now treats s as their absolute maximum (resp. minimum), so rf/min and rf/max are now associative and practically s are ignored.
This commit is contained in:
parent
0410484f90
commit
545b97ddf8
3 changed files with 18 additions and 4 deletions
|
|
@ -40,7 +40,7 @@ In `net.cgrand.xforms.io`:
|
||||||
Add this dependency to your project:
|
Add this dependency to your project:
|
||||||
|
|
||||||
```clj
|
```clj
|
||||||
[net.cgrand/xforms "0.18.1"]
|
[net.cgrand/xforms "0.18.2"]
|
||||||
```
|
```
|
||||||
|
|
||||||
```clj
|
```clj
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
(defproject net.cgrand/xforms "0.18.1"
|
(defproject net.cgrand/xforms "0.18.2"
|
||||||
:description "Extra transducers for Clojure"
|
:description "Extra transducers for Clojure"
|
||||||
:url "https://github.com/cgrand/xforms"
|
:url "https://github.com/cgrand/xforms"
|
||||||
:license {:name "Eclipse Public License"
|
:license {:name "Eclipse Public License"
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,14 @@
|
||||||
|
|
||||||
(defn minimum
|
(defn minimum
|
||||||
([comparator]
|
([comparator]
|
||||||
(minimum comparator nil))
|
(fn
|
||||||
|
([] nil)
|
||||||
|
([x] x)
|
||||||
|
([a b] (cond
|
||||||
|
(nil? a) b
|
||||||
|
(nil? b) a
|
||||||
|
(pos? (#?(:clj .compare :cljs cmp) comparator a b)) b
|
||||||
|
:else a))))
|
||||||
([#?(:clj ^java.util.Comparator comparator :cljs comparator) absolute-maximum]
|
([#?(:clj ^java.util.Comparator comparator :cljs comparator) absolute-maximum]
|
||||||
(fn
|
(fn
|
||||||
([] ::+∞)
|
([] ::+∞)
|
||||||
|
|
@ -40,7 +47,14 @@
|
||||||
|
|
||||||
(defn maximum
|
(defn maximum
|
||||||
([comparator]
|
([comparator]
|
||||||
(maximum comparator nil))
|
(fn
|
||||||
|
([] nil)
|
||||||
|
([x] x)
|
||||||
|
([a b] (cond
|
||||||
|
(nil? a) b
|
||||||
|
(nil? b) a
|
||||||
|
(neg? (#?(:clj .compare :cljs cmp) comparator a b)) b
|
||||||
|
:else a))))
|
||||||
([#?(:clj ^java.util.Comparator comparator :cljs comparator) absolute-minimum]
|
([#?(:clj ^java.util.Comparator comparator :cljs comparator) absolute-minimum]
|
||||||
(fn
|
(fn
|
||||||
([] ::-∞)
|
([] ::-∞)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue