diff options
author | Eduardo Julian | 2018-04-15 02:24:27 -0400 |
---|---|---|
committer | Eduardo Julian | 2018-04-15 02:24:27 -0400 |
commit | 6eb9cf17f161522d4eddf6783284952f8a84f099 (patch) | |
tree | 9158749544826d8d0940117ca5884fdd2f90c327 /new-luxc/source/luxc/lang/translation/r/procedure/common.jvm.lux | |
parent | 0bba53ceb52502510e0f6ba4c53a951933532a61 (diff) |
- Fixes for R back-end.
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.lux | 16 |
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))))))) |