From e6cbd132125eab9fe72e1c17df5f4c4bcfb32f20 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Tue, 23 May 2017 19:46:10 -0400 Subject: - Implemented Real<->Bits conversion (and used it to implement Hash). --- luxc/src/lux/analyser/proc/common.clj | 2 -- luxc/src/lux/compiler/js/proc/common.clj | 7 ------- luxc/src/lux/compiler/jvm/proc/common.clj | 11 ----------- 3 files changed, 20 deletions(-) (limited to 'luxc/src') diff --git a/luxc/src/lux/analyser/proc/common.clj b/luxc/src/lux/analyser/proc/common.clj index 29797224f..a0430feb7 100644 --- a/luxc/src/lux/analyser/proc/common.clj +++ b/luxc/src/lux/analyser/proc/common.clj @@ -299,7 +299,6 @@ ^:private analyse-int-to-real &type/Int &type/Real ["int" "to-real"] ^:private analyse-real-to-int &type/Real &type/Int ["real" "to-int"] - ^:private analyse-real-hash &type/Real &type/Nat ["real" "hash"] ^:private analyse-char-to-text &type/Char &type/Text ["char" "to-text"] @@ -597,7 +596,6 @@ "negative-infinity" (analyse-real-negative-infinity analyse exo-type ?values) "to-deg" (analyse-real-to-deg analyse exo-type ?values) "to-int" (analyse-real-to-int analyse exo-type ?values) - "hash" (analyse-real-hash analyse exo-type ?values) ) "char" diff --git a/luxc/src/lux/compiler/js/proc/common.clj b/luxc/src/lux/compiler/js/proc/common.clj index 2f872676e..871f5e15b 100644 --- a/luxc/src/lux/compiler/js/proc/common.clj +++ b/luxc/src/lux/compiler/js/proc/common.clj @@ -151,12 +151,6 @@ ^:private compile-real-decode "decodeReal" ) -(defn ^:private compile-real-hash [compile ?values special-args] - (|do [:let [(&/$Cons ?x (&/$Nil)) ?values] - =x (compile ?x)] - (return (str "LuxRT$textHash(''+" =x ")")) - )) - (do-template [ ] (defn [compile ?values special-args] (|do [:let [(&/$Nil) ?values]] @@ -549,7 +543,6 @@ "negative-infinity" (compile-real-negative-infinity compile ?values special-args) "to-deg" (compile-real-to-deg compile ?values special-args) "to-int" (compile-real-to-int compile ?values special-args) - "hash" (compile-real-hash compile ?values special-args) ) "char" diff --git a/luxc/src/lux/compiler/jvm/proc/common.clj b/luxc/src/lux/compiler/jvm/proc/common.clj index 1fe49d227..821fcc619 100644 --- a/luxc/src/lux/compiler/jvm/proc/common.clj +++ b/luxc/src/lux/compiler/jvm/proc/common.clj @@ -299,16 +299,6 @@ ^:private compile-char-lt Opcodes/IF_ICMPLT &&/unwrap-char ) -(defn ^:private compile-real-hash [compile ?values special-args] - (|do [:let [(&/$Cons ?input (&/$Nil)) ?values] - ^MethodVisitor *writer* &/get-writer - _ (compile ?input) - :let [_ (doto *writer* - &&/unwrap-double - (.visitMethodInsn Opcodes/INVOKESTATIC "java/lang/Double" "doubleToRawLongBits" "(D)J") - &&/wrap-long)]] - (return nil))) - (do-template [ ] (defn [compile ?values special-args] (|do [:let [(&/$Cons ?x (&/$Cons ?y (&/$Nil))) ?values] @@ -966,7 +956,6 @@ "%" (compile-real-rem compile ?values special-args) "=" (compile-real-eq compile ?values special-args) "<" (compile-real-lt compile ?values special-args) - "hash" (compile-real-hash compile ?values special-args) "smallest-value" (compile-real-smallest-value compile ?values special-args) "max-value" (compile-real-max-value compile ?values special-args) "min-value" (compile-real-min-value compile ?values special-args) -- cgit v1.2.3