Skip to content

Commit

Permalink
remove ireal
Browse files Browse the repository at this point in the history
  • Loading branch information
sritchie committed Apr 9, 2024
1 parent 69030e7 commit d3a16ba
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 37 deletions.
2 changes: 1 addition & 1 deletion src/emmy/env.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -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])
3 changes: 0 additions & 3 deletions src/emmy/ratio.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
42 changes: 9 additions & 33 deletions src/emmy/value.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@

(defprotocol INumericTower)

(defprotocol IReal)

(defprotocol IKind
(kind [this]))

Expand Down Expand Up @@ -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)
Expand All @@ -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))))
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit d3a16ba

Please sign in to comment.