diff options
author | Eduardo Julian | 2019-04-28 01:48:04 -0400 |
---|---|---|
committer | Eduardo Julian | 2019-04-28 01:48:04 -0400 |
commit | 41b83b7a2d3be8f454f780dca497c4eeed900bbf (patch) | |
tree | 8b5eadd88e0f51a2d0e891e5c0708f0fa9b740fb | |
parent | 78044833d179b8dd168c665f9616ce78901f0ff4 (diff) |
Turned all "lux frac ???" extensions to "lux f64 ???".
Diffstat (limited to '')
-rw-r--r-- | luxc/src/lux/analyser/proc/common.clj | 54 | ||||
-rw-r--r-- | luxc/src/lux/compiler/jvm/proc/common.clj | 6 | ||||
-rw-r--r-- | new-luxc/source/luxc/lang/translation/jvm/procedure/common.lux | 14 | ||||
-rw-r--r-- | stdlib/source/lux.lux | 18 | ||||
-rw-r--r-- | stdlib/source/lux/data/number/frac.lux | 10 | ||||
-rw-r--r-- | stdlib/source/lux/tool/compiler/phase/extension/analysis/common.lux | 10 | ||||
-rw-r--r-- | stdlib/source/spec/compositor/generation/common.lux | 14 | ||||
-rw-r--r-- | stdlib/source/test/lux/tool/compiler/phase/extension/analysis/common.lux | 26 |
8 files changed, 76 insertions, 76 deletions
diff --git a/luxc/src/lux/analyser/proc/common.clj b/luxc/src/lux/analyser/proc/common.clj index cbe741a34..d08b6f402 100644 --- a/luxc/src/lux/analyser/proc/common.clj +++ b/luxc/src/lux/analyser/proc/common.clj @@ -156,13 +156,13 @@ analyse-int-rem ["int" "%"] &type/Int &type/Int analyse-int-lt ["int" "<"] &type/Int &type/Bit - analyse-frac-add ["frac" "+"] &type/Frac &type/Frac - analyse-frac-sub ["frac" "-"] &type/Frac &type/Frac - analyse-frac-mul ["frac" "*"] &type/Frac &type/Frac - analyse-frac-div ["frac" "/"] &type/Frac &type/Frac - analyse-frac-rem ["frac" "%"] &type/Frac &type/Frac - analyse-frac-eq ["frac" "="] &type/Frac &type/Bit - analyse-frac-lt ["frac" "<"] &type/Frac &type/Bit + analyse-frac-add ["f64" "+"] &type/Frac &type/Frac + analyse-frac-sub ["f64" "-"] &type/Frac &type/Frac + analyse-frac-mul ["f64" "*"] &type/Frac &type/Frac + analyse-frac-div ["f64" "/"] &type/Frac &type/Frac + analyse-frac-rem ["f64" "%"] &type/Frac &type/Frac + analyse-frac-eq ["f64" "="] &type/Frac &type/Bit + analyse-frac-lt ["f64" "<"] &type/Frac &type/Bit ) (do-template [<encode> <encode-op> <decode> <decode-op> <type>] @@ -183,7 +183,7 @@ (return (&/|list (&&/|meta exo-type _cursor (&&/$proc (&/T <decode-op>) (&/|list =x) (&/|list))))))))) - analyse-frac-encode ["frac" "encode"] analyse-frac-decode ["frac" "decode"] &type/Frac + analyse-frac-encode ["f64" "encode"] analyse-frac-decode ["f64" "decode"] &type/Frac ) (do-template [<name> <type> <op>] @@ -194,9 +194,9 @@ (return (&/|list (&&/|meta exo-type _cursor (&&/$proc (&/T <op>) (&/|list) (&/|list))))))) - analyse-frac-smallest &type/Frac ["frac" "smallest"] - analyse-frac-min &type/Frac ["frac" "min"] - analyse-frac-max &type/Frac ["frac" "max"] + analyse-frac-smallest &type/Frac ["f64" "smallest"] + analyse-frac-min &type/Frac ["f64" "min"] + analyse-frac-max &type/Frac ["f64" "max"] ) (do-template [<name> <from-type> <to-type> <op>] @@ -209,8 +209,8 @@ (&&/$proc (&/T <op>) (&/|list =x) (&/|list))))))) analyse-int-char &type/Int &type/Text ["int" "char"] - analyse-int-frac &type/Int &type/Frac ["int" "frac"] - analyse-frac-int &type/Frac &type/Int ["frac" "int"] + analyse-int-frac &type/Int &type/Frac ["int" "f64"] + analyse-frac-int &type/Frac &type/Int ["f64" "i64"] analyse-io-log &type/Text &type/Any ["io" "log"] analyse-io-error &type/Text &type/Nothing ["io" "error"] @@ -278,22 +278,22 @@ "lux int /" (analyse-int-div analyse exo-type ?values) "lux int %" (analyse-int-rem analyse exo-type ?values) "lux int <" (analyse-int-lt analyse exo-type ?values) - "lux int frac" (analyse-int-frac analyse exo-type ?values) + "lux int f64" (analyse-int-frac analyse exo-type ?values) "lux int char" (analyse-int-char analyse exo-type ?values) - "lux frac +" (analyse-frac-add analyse exo-type ?values) - "lux frac -" (analyse-frac-sub analyse exo-type ?values) - "lux frac *" (analyse-frac-mul analyse exo-type ?values) - "lux frac /" (analyse-frac-div analyse exo-type ?values) - "lux frac %" (analyse-frac-rem analyse exo-type ?values) - "lux frac =" (analyse-frac-eq analyse exo-type ?values) - "lux frac <" (analyse-frac-lt analyse exo-type ?values) - "lux frac encode" (analyse-frac-encode analyse exo-type ?values) - "lux frac decode" (analyse-frac-decode analyse exo-type ?values) - "lux frac smallest" (analyse-frac-smallest analyse exo-type ?values) - "lux frac min" (analyse-frac-min analyse exo-type ?values) - "lux frac max" (analyse-frac-max analyse exo-type ?values) - "lux frac int" (analyse-frac-int analyse exo-type ?values) + "lux f64 +" (analyse-frac-add analyse exo-type ?values) + "lux f64 -" (analyse-frac-sub analyse exo-type ?values) + "lux f64 *" (analyse-frac-mul analyse exo-type ?values) + "lux f64 /" (analyse-frac-div analyse exo-type ?values) + "lux f64 %" (analyse-frac-rem analyse exo-type ?values) + "lux f64 =" (analyse-frac-eq analyse exo-type ?values) + "lux f64 <" (analyse-frac-lt analyse exo-type ?values) + "lux f64 encode" (analyse-frac-encode analyse exo-type ?values) + "lux f64 decode" (analyse-frac-decode analyse exo-type ?values) + "lux f64 smallest" (analyse-frac-smallest analyse exo-type ?values) + "lux f64 min" (analyse-frac-min analyse exo-type ?values) + "lux f64 max" (analyse-frac-max analyse exo-type ?values) + "lux f64 i64" (analyse-frac-int analyse exo-type ?values) ;; Special extensions for performance reasons ;; Will be replaced by custom extensions in the future. diff --git a/luxc/src/lux/compiler/jvm/proc/common.clj b/luxc/src/lux/compiler/jvm/proc/common.clj index 96b2dcc31..bf1ca306e 100644 --- a/luxc/src/lux/compiler/jvm/proc/common.clj +++ b/luxc/src/lux/compiler/jvm/proc/common.clj @@ -456,11 +456,11 @@ "/" (compile-int-div compile ?values special-args) "%" (compile-int-rem compile ?values special-args) "<" (compile-int-lt compile ?values special-args) - "frac" (compile-int-frac compile ?values special-args) + "f64" (compile-int-frac compile ?values special-args) "char" (compile-int-char compile ?values special-args) ) - "frac" + "f64" (case proc "+" (compile-frac-add compile ?values special-args) "-" (compile-frac-sub compile ?values special-args) @@ -472,7 +472,7 @@ "smallest" (compile-frac-smallest compile ?values special-args) "max" (compile-frac-max compile ?values special-args) "min" (compile-frac-min compile ?values special-args) - "int" (compile-frac-int compile ?values special-args) + "i64" (compile-frac-int compile ?values special-args) "encode" (compile-frac-encode compile ?values special-args) "decode" (compile-frac-decode compile ?values special-args) ) diff --git a/new-luxc/source/luxc/lang/translation/jvm/procedure/common.lux b/new-luxc/source/luxc/lang/translation/jvm/procedure/common.lux index cead0848e..e9a72b2f1 100644 --- a/new-luxc/source/luxc/lang/translation/jvm/procedure/common.lux +++ b/new-luxc/source/luxc/lang/translation/jvm/procedure/common.lux @@ -150,11 +150,11 @@ (Unary Inst) (|>> inputI <prepare> <transform>))] - [int::frac (_.unwrap #_t.Long) (<| (_.wrap #_t.Double) _.L2D)] + [int::f64 (_.unwrap #_t.Long) (<| (_.wrap #_t.Double) _.L2D)] [int::char (_.unwrap #_t.Long) ((|>> _.L2I _.I2C (_.INVOKESTATIC "java.lang.Character" "toString" (_t.method (list _t.char) (#.Some $String) (list)) #0)))] - [frac::int (_.unwrap #_t.Double) (<| (_.wrap #_t.Long) _.D2L)] + [frac::i64 (_.unwrap #_t.Double) (<| (_.wrap #_t.Long) _.D2L)] [frac::encode (_.unwrap #_t.Double) (_.INVOKESTATIC "java.lang.Double" "toString" (_t.method (list _t.double) (#.Some $String) (list)) #0)] [frac::decode ..check-stringI @@ -276,12 +276,12 @@ (bundle.install "/" (binary int::/)) (bundle.install "%" (binary int::%)) (bundle.install "<" (binary int::<)) - (bundle.install "frac" (unary int::frac)) + (bundle.install "f64" (unary int::f64)) (bundle.install "char" (unary int::char))))) -(def: bundle::frac +(def: bundle::f64 Bundle - (<| (bundle.prefix "frac") + (<| (bundle.prefix "f64") (|> (: Bundle bundle.empty) (bundle.install "+" (binary frac::+)) (bundle.install "-" (binary frac::-)) @@ -293,7 +293,7 @@ (bundle.install "smallest" (nullary frac::smallest)) (bundle.install "min" (nullary frac::min)) (bundle.install "max" (nullary frac::max)) - (bundle.install "int" (unary frac::int)) + (bundle.install "i64" (unary frac::i64)) (bundle.install "encode" (unary frac::encode)) (bundle.install "decode" (unary frac::decode))))) @@ -324,6 +324,6 @@ (|> bundle::lux (dictionary.merge bundle::i64) (dictionary.merge bundle::int) - (dictionary.merge bundle::frac) + (dictionary.merge bundle::f64) (dictionary.merge bundle::text) (dictionary.merge bundle::io)))) diff --git a/stdlib/source/lux.lux b/stdlib/source/lux.lux index 6fe8100ba..be997fc2e 100644 --- a/stdlib/source/lux.lux +++ b/stdlib/source/lux.lux @@ -2373,7 +2373,7 @@ [ Int "lux i64 =" "lux int <" i/= i/< i/<= i/> i/>= "Int(eger) equivalence." "Int(eger) less-than." "Int(eger) less-than-equal." "Int(eger) greater-than." "Int(eger) greater-than-equal."] - [Frac "lux frac =" "lux frac <" f/= f/< f/<= f/> f/>= + [Frac "lux f64 =" "lux f64 <" f/= f/< f/<= f/> f/>= "Frac(tion) equivalence." "Frac(tion) less-than." "Frac(tion) less-than-equal." "Frac(tion) greater-than." "Frac(tion) greater-than-equal."] ) @@ -2441,11 +2441,11 @@ [ Int i// "lux int /" "Int(eger) division."] [ Int i/% "lux int %" "Int(eger) remainder."] - [Frac f/+ "lux frac +" "Frac(tion) addition."] - [Frac f/- "lux frac -" "Frac(tion) substraction."] - [Frac f/* "lux frac *" "Frac(tion) multiplication."] - [Frac f// "lux frac /" "Frac(tion) division."] - [Frac f/% "lux frac %" "Frac(tion) remainder."] + [Frac f/+ "lux f64 +" "Frac(tion) addition."] + [Frac f/- "lux f64 -" "Frac(tion) substraction."] + [Frac f/* "lux f64 *" "Frac(tion) multiplication."] + [Frac f// "lux f64 /" "Frac(tion) division."] + [Frac f/% "lux f64 %" "Frac(tion) remainder."] ) (def:''' #export (r/* param subject) @@ -2608,7 +2608,7 @@ (def:''' (frac@encode x) #Nil (-> Frac Text) - ("lux frac encode" x)) + ("lux f64 encode" x)) (def:''' (multiple? div n) #Nil @@ -5183,8 +5183,8 @@ (-> <from> <to>) (<proc> n))] - [frac-to-int Frac Int "lux frac int"] - [int-to-frac Int Frac "lux int frac"] + [frac-to-int Frac Int "lux f64 i64"] + [int-to-frac Int Frac "lux int f64"] ) (def: (find-baseline-column code) diff --git a/stdlib/source/lux/data/number/frac.lux b/stdlib/source/lux/data/number/frac.lux index 7c5f52b7f..5a816df33 100644 --- a/stdlib/source/lux/data/number/frac.lux +++ b/stdlib/source/lux/data/number/frac.lux @@ -49,8 +49,8 @@ [addition f/+ +0.0] [multiplication f/* +1.0] - [maximum f/max ("lux frac min")] - [minimum f/min ("lux frac max")] + [maximum f/max ("lux f64 min")] + [minimum f/min ("lux f64 max")] ) (template [<name> <numerator> <doc>] @@ -78,11 +78,11 @@ (structure: #export decimal (Codec Text Frac) (def: (encode x) (if (f/< +0.0 x) - ("lux frac encode" x) - ("lux text concat" "+" ("lux frac encode" x)))) + ("lux f64 encode" x) + ("lux text concat" "+" ("lux f64 encode" x)))) (def: (decode input) - (case ("lux frac decode" [input]) + (case ("lux f64 decode" [input]) (#.Some value) (#error.Success value) diff --git a/stdlib/source/lux/tool/compiler/phase/extension/analysis/common.lux b/stdlib/source/lux/tool/compiler/phase/extension/analysis/common.lux index 20061db55..7afbb3331 100644 --- a/stdlib/source/lux/tool/compiler/phase/extension/analysis/common.lux +++ b/stdlib/source/lux/tool/compiler/phase/extension/analysis/common.lux @@ -172,12 +172,12 @@ (///bundle.install "/" (binary Int Int Int)) (///bundle.install "%" (binary Int Int Int)) (///bundle.install "<" (binary Int Int Bit)) - (///bundle.install "frac" (unary Int Frac)) + (///bundle.install "f64" (unary Int Frac)) (///bundle.install "char" (unary Int Text))))) -(def: bundle::frac +(def: bundle::f64 Bundle - (<| (///bundle.prefix "frac") + (<| (///bundle.prefix "f64") (|> ///bundle.empty (///bundle.install "+" (binary Frac Frac Frac)) (///bundle.install "-" (binary Frac Frac Frac)) @@ -189,7 +189,7 @@ (///bundle.install "smallest" (nullary Frac)) (///bundle.install "min" (nullary Frac)) (///bundle.install "max" (nullary Frac)) - (///bundle.install "int" (unary Frac Int)) + (///bundle.install "i64" (unary Frac Int)) (///bundle.install "encode" (unary Frac Text)) (///bundle.install "decode" (unary Text (type (Maybe Frac))))))) @@ -213,7 +213,7 @@ (dictionary.merge (bundle::lux eval)) (dictionary.merge bundle::i64) (dictionary.merge bundle::int) - (dictionary.merge bundle::frac) + (dictionary.merge bundle::f64) (dictionary.merge bundle::text) (dictionary.merge bundle::io) ))) diff --git a/stdlib/source/spec/compositor/generation/common.lux b/stdlib/source/spec/compositor/generation/common.lux index c92859639..8ed524efe 100644 --- a/stdlib/source/spec/compositor/generation/common.lux +++ b/stdlib/source/spec/compositor/generation/common.lux @@ -157,15 +157,15 @@ (run (..sanitize <extension>)) (//case.verify <reference>)))] - ["lux f64 min" ("lux frac min")] - ["lux f64 max" ("lux frac max")] - ["lux f64 smallest" ("lux frac smallest")] + ["lux f64 min" ("lux f64 min")] + ["lux f64 max" ("lux f64 max")] + ["lux f64 smallest" ("lux f64 smallest")] )) - (_.test "'lux f64 to-i64' && 'lux i64 to-f64'" - (|> (run (..sanitize "lux f64 to-i64") + (_.test "'lux f64 i64 && 'lux i64 f64'" + (|> (run (..sanitize "lux f64 i64") (|> subject synthesis.f64 - (list) (#synthesis.Extension "lux f64 to-i64") - (list) (#synthesis.Extension "lux i64 to-f64"))) + (list) (#synthesis.Extension "lux f64 i64") + (list) (#synthesis.Extension "lux i64 f64"))) (//case.verify subject))) )))) diff --git a/stdlib/source/test/lux/tool/compiler/phase/extension/analysis/common.lux b/stdlib/source/test/lux/tool/compiler/phase/extension/analysis/common.lux index 7980118a0..b6f7fb10c 100644 --- a/stdlib/source/test/lux/tool/compiler/phase/extension/analysis/common.lux +++ b/stdlib/source/test/lux/tool/compiler/phase/extension/analysis/common.lux @@ -120,31 +120,31 @@ encodedC (|> r.safe-frac (:: @ map (|>> %f code.text)))] ($_ _.and (_.test "Can add frac numbers." - (check-success+ "lux frac +" (list paramC subjectC) Frac)) + (check-success+ "lux f64 +" (list paramC subjectC) Frac)) (_.test "Can subtract frac numbers." - (check-success+ "lux frac -" (list paramC subjectC) Frac)) + (check-success+ "lux f64 -" (list paramC subjectC) Frac)) (_.test "Can multiply frac numbers." - (check-success+ "lux frac *" (list paramC subjectC) Frac)) + (check-success+ "lux f64 *" (list paramC subjectC) Frac)) (_.test "Can divide frac numbers." - (check-success+ "lux frac /" (list paramC subjectC) Frac)) + (check-success+ "lux f64 /" (list paramC subjectC) Frac)) (_.test "Can calculate remainder of frac numbers." - (check-success+ "lux frac %" (list paramC subjectC) Frac)) + (check-success+ "lux f64 %" (list paramC subjectC) Frac)) (_.test "Can test equivalence of frac numbers." - (check-success+ "lux frac =" (list paramC subjectC) Bit)) + (check-success+ "lux f64 =" (list paramC subjectC) Bit)) (_.test "Can compare frac numbers." - (check-success+ "lux frac <" (list paramC subjectC) Bit)) + (check-success+ "lux f64 <" (list paramC subjectC) Bit)) (_.test "Can obtain minimum frac number." - (check-success+ "lux frac min" (list) Frac)) + (check-success+ "lux f64 min" (list) Frac)) (_.test "Can obtain maximum frac number." - (check-success+ "lux frac max" (list) Frac)) + (check-success+ "lux f64 max" (list) Frac)) (_.test "Can obtain smallest frac number." - (check-success+ "lux frac smallest" (list) Frac)) + (check-success+ "lux f64 smallest" (list) Frac)) (_.test "Can convert frac number to integer." - (check-success+ "lux frac int" (list subjectC) Int)) + (check-success+ "lux f64 i64" (list subjectC) Int)) (_.test "Can convert frac number to text." - (check-success+ "lux frac encode" (list subjectC) Text)) + (check-success+ "lux f64 encode" (list subjectC) Text)) (_.test "Can convert text to frac number." - (check-success+ "lux frac decode" (list encodedC) (type (Maybe Frac)))) + (check-success+ "lux f64 decode" (list encodedC) (type (Maybe Frac)))) ))) (def: text |