aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/lux.lux
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--stdlib/source/lux.lux81
1 files changed, 3 insertions, 78 deletions
diff --git a/stdlib/source/lux.lux b/stdlib/source/lux.lux
index aff2f300a..f347c281a 100644
--- a/stdlib/source/lux.lux
+++ b/stdlib/source/lux.lux
@@ -2278,9 +2278,6 @@
[ Int "lux i64 =" "lux i64 <" 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 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."]
)
(def:''' #export (n// param subject)
@@ -2343,15 +2340,9 @@
(-> <type> <type> <type>)
(<op> param subject))]
- [ Int i/* "lux i64 *" "Int(eger) multiplication."]
- [ Int i// "lux i64 /" "Int(eger) division."]
- [ Int i/% "lux i64 %" "Int(eger) 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."]
+ [Int i/* "lux i64 *" "Int(eger) multiplication."]
+ [Int i// "lux i64 /" "Int(eger) division."]
+ [Int i/% "lux i64 %" "Int(eger) remainder."]
)
(def:''' #export (r/* param subject)
@@ -2449,9 +2440,6 @@
[r/min Rev r/< "Rev(olution) minimum."]
[r/max Rev r/> "Rev(olution) maximum."]
-
- [f/min Frac f/< "Frac(tion) minimum."]
- [f/max Frac f/> "Frac(tion) minimum."]
)
(def:''' (bit@encode x)
@@ -5097,15 +5085,6 @@
_
(fail "Wrong syntax for ^template")))
-(template [<name> <from> <to> <proc>]
- [(def: #export (<name> n)
- (-> <from> <to>)
- (<proc> n))]
-
- [frac-to-int Frac Int "lux f64 i64"]
- [int-to-frac Int Frac "lux i64 f64"]
- )
-
(def: (find-baseline-column code)
(-> Code Nat)
(case code
@@ -6132,52 +6111,6 @@
_
(fail (..wrong-syntax-error (name-of ..^code)))))
-(def: #export (n/mod param subject)
- (-> Nat Nat Nat)
- (let [exact (|> subject (n// param) (n/* param))]
- (|> subject (n/- exact))))
-
-(def: #export (i/mod param subject)
- (All [m] (-> Int Int Int))
- (let [raw (i/% param subject)]
- (if (i/< +0 raw)
- (let [shift (if (i/< +0 param) i/- i/+)]
- (|> raw (shift param)))
- raw)))
-
-(template [<type> </%> </> <%>]
- [(def: #export (</%> param subject)
- (-> <type> <type> [<type> <type>])
- [(</> param subject)
- (<%> param subject)])]
-
- [Int i//% i// i/%]
- [Rev r//% r// r/%]
- [Frac f//% f// f/%]
- )
-
-(def: to-significand
- (-> (I64 Any) Frac)
- (|>> ("lux i64 logical-right-shift" 11)
- int-to-frac))
-
-(def: rev-denominator Frac (to-significand -1))
-
-(def: #export (frac-to-rev input)
- (-> Frac Rev)
- (let [abs (if (f/< +0.0 input)
- (f/* -1.0 input)
- input)]
- (|> abs
- (f/% +1.0)
- (f/* rev-denominator)
- frac-to-int
- ("lux i64 left-shift" 11))))
-
-(def: #export rev-to-frac
- (-> Rev Frac)
- (|>> to-significand (f// rev-denominator)))
-
(def: #export (cursor-description [file line column])
(-> Cursor Text)
(let [separator ", "
@@ -6195,11 +6128,3 @@
[no yes]
[off on]
)
-
-(def: #export nat-to-frac
- (-> Nat Frac)
- (|>> ..int ..int-to-frac))
-
-(def: #export frac-to-nat
- (-> Frac Nat)
- (|>> ..frac-to-int ..nat))