From d3a16ba7c4ce2d3b7ee8632312171c7b07bcc839 Mon Sep 17 00:00:00 2001 From: Sam Ritchie Date: Tue, 9 Apr 2024 14:18:53 -0600 Subject: [PATCH] remove ireal --- src/emmy/env.cljc | 2 +- src/emmy/ratio.cljc | 3 --- src/emmy/value.cljc | 42 +++++++++--------------------------------- 3 files changed, 10 insertions(+), 37 deletions(-) diff --git a/src/emmy/env.cljc b/src/emmy/env.cljc index 746e38e1..7774ddeb 100644 --- a/src/emmy/env.cljc +++ b/src/emmy/env.cljc @@ -581,4 +581,4 @@ [emmy.special.elliptic elliptic-f] [emmy.special.factorial factorial] [emmy.value = compare - numerical? kind kind-predicate principal-value]) + kind kind-predicate principal-value]) diff --git a/src/emmy/ratio.cljc b/src/emmy/ratio.cljc index dc2c4d1a..0fd845c1 100644 --- a/src/emmy/ratio.cljc +++ b/src/emmy/ratio.cljc @@ -120,12 +120,9 @@ :cljs (do - (extend-type bf/Fraction v/INumericTower - v/IReal - #?@(:cljs [IEquiv (-equiv [x other] (cond (instance? bf/Fraction other) (bf/eq x other) diff --git a/src/emmy/value.cljc b/src/emmy/value.cljc index 02f9bc6f..a34d86b0 100644 --- a/src/emmy/value.cljc +++ b/src/emmy/value.cljc @@ -22,8 +22,6 @@ (defprotocol INumericTower) -(defprotocol IReal) - (defprotocol IKind (kind [this])) @@ -127,17 +125,6 @@ (derive goog.math.Integer ::integral) (derive goog.math.Long ::integral))) -(extend-protocol Numerical - #?(:clj Number :cljs number) - (numerical? [_] true) - - #?@(:clj - [java.lang.Double - (numerical? [_] true) - - java.lang.Float - (numerical? [_] true)])) - (extend-protocol IKind #?(:clj Number :cljs number) (kind [x] #?(:clj (type x) @@ -159,8 +146,8 @@ nil (kind [_] nil) -;; Var -;; (kind [v] (type v)) + ;; Var + ;; (kind [v] (type v)) #?(:clj Object :cljs default) (kind [o] (:type o (type o)))) @@ -298,26 +285,15 @@ #?(:cljs ;; ClojureScript-specific implementations of Value. - (do - (extend-protocol Numerical - js/BigInt - (numerical? [_] true) - - goog.math.Integer - (numerical? [_] true) - - goog.math.Long - (numerical? [_] true)) - - (extend-protocol IKind - js/BigInt - (kind [_] js/BigInt) + (extend-protocol IKind + js/BigInt + (kind [_] js/BigInt) - goog.math.Integer - (kind [_] goog.math.Integer) + goog.math.Integer + (kind [_] goog.math.Integer) - goog.math.Long - (kind [_] goog.math.Long)))) + goog.math.Long + (kind [_] goog.math.Long))) #?(:cljs ;; We find it convenient to be able to decorate "vanilla" JavaScript