aboutsummaryrefslogtreecommitdiff
path: root/new-luxc/source/luxc/lang/translation/r/procedure/common.jvm.lux
diff options
context:
space:
mode:
Diffstat (limited to 'new-luxc/source/luxc/lang/translation/r/procedure/common.jvm.lux')
-rw-r--r--new-luxc/source/luxc/lang/translation/r/procedure/common.jvm.lux16
1 files changed, 11 insertions, 5 deletions
diff --git a/new-luxc/source/luxc/lang/translation/r/procedure/common.jvm.lux b/new-luxc/source/luxc/lang/translation/r/procedure/common.jvm.lux
index 1bcd560e9..bc2289f6a 100644
--- a/new-luxc/source/luxc/lang/translation/r/procedure/common.jvm.lux
+++ b/new-luxc/source/luxc/lang/translation/r/procedure/common.jvm.lux
@@ -165,7 +165,7 @@
(do-template [<name> <op>]
[(def: (<name> [subjectO paramO])
Binary
- (<op> paramO subjectO))]
+ (<op> (runtimeT.int64-low paramO) subjectO))]
[bit//shift-left runtimeT.bit//shift-left]
[bit//signed-shift-right runtimeT.bit//signed-shift-right]
@@ -312,6 +312,8 @@
(function (_ value)
(r.apply (list value) func)))
+(def: nat//char (|>> runtimeT.int64-low (apply1 (r.global "intToUtf8"))))
+
(def: nat-procs
Bundle
(<| (prefix "nat")
@@ -326,7 +328,7 @@
(install "min" (nullary nat//min))
(install "max" (nullary nat//max))
(install "to-int" (unary id))
- (install "char" (unary (apply1 (r.global "intToUtf8")))))))
+ (install "char" (unary nat//char)))))
(def: int-procs
Bundle
@@ -459,17 +461,21 @@
## [[IO]]
(def: (io//exit input)
- (-> Expression Expression)
+ Unary
(r.apply-kw (list)
(list ["status" (runtimeT.int//to-float input)])
(r.global "quit")))
+(def: (void code)
+ (-> Expression Expression)
+ (r.block (r.then code runtimeT.unit)))
+
(def: io-procs
Bundle
(<| (prefix "io")
(|> (dict.new text.Hash<Text>)
- (install "log" (unary (apply1 (r.global "print"))))
- (install "error" (unary (apply1 (r.global "stop"))))
+ (install "log" (unary (|>> r.print ..void)))
+ (install "error" (unary r.stop))
(install "exit" (unary io//exit))
(install "current-time" (nullary (function (_ _)
(runtimeT.io//current-time! runtimeT.unit)))))))