Re: Ratio implementation questions

2015-08-27 Thread waffletower
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

Re: Ratio implementation questions

2015-08-26 Thread Andy Fingerhut
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

Ratio implementation questions

2015-08-26 Thread Alex Miller
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

Ratio implementation questions

2015-08-26 Thread waffletower
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