aboutsummaryrefslogtreecommitdiff
path: root/new-luxc/source/luxc/lang/translation/ruby/procedure
diff options
context:
space:
mode:
authorEduardo Julian2018-05-07 01:37:38 -0400
committerEduardo Julian2018-05-07 01:37:38 -0400
commitfebfa99c2823219c2e76d2c73b1fd8db8f6c9918 (patch)
treef521419a80b04f465c6c9c5020c2063e2e555895 /new-luxc/source/luxc/lang/translation/ruby/procedure
parent3e2fddc6bfdda56dbe6947c476f85760b0811654 (diff)
- Implemented Deg functionality in pure Lux.
Diffstat (limited to '')
-rw-r--r--new-luxc/source/luxc/lang/translation/ruby/procedure/common.jvm.lux56
1 files changed, 3 insertions, 53 deletions
diff --git a/new-luxc/source/luxc/lang/translation/ruby/procedure/common.jvm.lux b/new-luxc/source/luxc/lang/translation/ruby/procedure/common.jvm.lux
index e38dfff28..729acd978 100644
--- a/new-luxc/source/luxc/lang/translation/ruby/procedure/common.jvm.lux
+++ b/new-luxc/source/luxc/lang/translation/ruby/procedure/common.jvm.lux
@@ -236,9 +236,6 @@
[frac//smallest Double::MIN_VALUE ruby.float]
[frac//min (f/* -1.0 Double::MAX_VALUE) ruby.float]
[frac//max Double::MAX_VALUE ruby.float]
-
- [deg//min 0 ruby.int]
- [deg//max -1 ruby.int]
)
(do-template [<name> <expression>]
@@ -278,14 +275,6 @@
[int//div ruby./]
[int//rem ruby.%]
-
- [deg//add ruby.+]
- [deg//sub ruby.-]
- [deg//mul runtimeT.deg//*]
- [deg//div runtimeT.deg///]
- [deg//rem ruby.-]
- [deg//scale ruby.*]
- [deg//reciprocal ruby./]
)
(do-template [<name> <op>]
@@ -312,8 +301,7 @@
[int//= ruby.=]
[int//< ruby.<]
- [deg//= ruby.=]
- [deg//< ruby.<])
+ )
(def: frac//encode
Unary
@@ -331,25 +319,6 @@
(ruby.return! (runtimeT.some "temp"))
(ruby.return! runtimeT.none)))))))
-(do-template [<name> <divisor>]
- [(def: (<name> inputO)
- Unary
- (ruby./ <divisor> inputO))]
-
- [int//to-frac (ruby.float 1.0)]
- [deg//to-frac (ruby.send "to_f" (list)
- (ruby.bit-shl (ruby.int 32) (ruby.int 1)))]
- )
-
-(do-template [<name> <transform>]
- [(def: <name>
- Unary
- <transform>)]
-
- [frac//to-int (ruby.send "floor" (list))]
- [frac//to-deg runtimeT.deg//from-frac]
- )
-
(def: int-procs
Bundle
(<| (prefix "int")
@@ -363,26 +332,9 @@
(install "<" (binary int//<))
(install "min" (nullary int//min))
(install "max" (nullary int//max))
- (install "to-frac" (unary int//to-frac))
+ (install "to-frac" (unary (ruby./ (ruby.float 1.0))))
(install "char" (unary (ruby.send "chr" (list)))))))
-(def: deg-procs
- Bundle
- (<| (prefix "deg")
- (|> (dict.new text.Hash<Text>)
- (install "+" (binary deg//add))
- (install "-" (binary deg//sub))
- (install "*" (binary deg//mul))
- (install "/" (binary deg//div))
- (install "%" (binary deg//rem))
- (install "=" (binary deg//=))
- (install "<" (binary deg//<))
- (install "scale" (binary deg//scale))
- (install "reciprocal" (binary deg//reciprocal))
- (install "min" (nullary deg//min))
- (install "max" (nullary deg//max))
- (install "to-frac" (unary deg//to-frac)))))
-
(def: frac-procs
Bundle
(<| (prefix "frac")
@@ -400,8 +352,7 @@
(install "not-a-number" (nullary frac//not-a-number))
(install "positive-infinity" (nullary frac//positive-infinity))
(install "negative-infinity" (nullary frac//negative-infinity))
- (install "to-deg" (unary frac//to-deg))
- (install "to-int" (unary frac//to-int))
+ (install "to-int" (unary (ruby.send "floor" (list))))
(install "encode" (unary frac//encode))
(install "decode" (unary frac//decode)))))
@@ -608,7 +559,6 @@
(|> lux-procs
(dict.merge bit-procs)
(dict.merge int-procs)
- (dict.merge deg-procs)
(dict.merge frac-procs)
(dict.merge text-procs)
(dict.merge array-procs)