I find the semantic of the new (any?) function to be in conflict with
(not-any?) and a strange addition, at least with the chosen name. This
concern has come up on the "clojure dev" group as well. I have found a
different implementation of (any?) useful in my own projects:
(defn any?
[pred
trary predicate function would evaluate against a collection.
On Sunday, November 6, 2016 at 5:05:45 PM UTC-8, James Reeves wrote:
>
> On 6 November 2016 at 23:31, waffletower > wrote:
>
>> I find the semantic of the new (any?) function to be in conflict with
>> (not-any?) and
Not to try to force the last word, but I have already created the symmetry
that I desire locally:
(defn not-not-any?
[pred coll]
(not (not-any? pred coll)))
On Tuesday, November 8, 2016 at 8:27:09 AM UTC-8, Colin Yates wrote:
>
> > Back at ya. I respect your opinion - I just see things diff
Would someone care to rationalize the implementation of (rationalize)?
(type (rationalize (/ 64 8)))
java.lang.Long
(type (rationalize (/ 64 7)))
clojure.lang.Ratio
(type (rationalize (/ 49 7)))
java.lang.Long
(type (rationalize (/ 49 6)))
clojure.lang.Ratio
Extraordinarily thorny to alternate ty
A workaround for integer types is totally trivial:
(defn my-numerator [x]
(if (ratio? x)
(numerator x)
x)
)
(defn my-denominator [x]
(if (ratio? x)
(denominator x)
1)
)
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post