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
On Wed, Aug 26, 2015 at 3:26 PM, waffletower
wrote:
> Would someone care to rationalize the implementation of (rationalize)?
>
Sorry, I don't have an answer of the form "Rich Hickey's rationale for this
behavior is X", because I don't know what X is for this behavior. I can
point out a few thin
This is logged at http://dev.clojure.org/jira/browse/CLJ-1435 - feel free to
vote for it.
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - p
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