aboutsummaryrefslogtreecommitdiff
path: root/new-luxc/source/luxc/lang/translation/r
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--new-luxc/source/luxc/lang/translation/r.lux4
-rw-r--r--new-luxc/source/luxc/lang/translation/r/eval.jvm.lux2
-rw-r--r--new-luxc/source/luxc/lang/translation/r/function.jvm.lux8
-rw-r--r--new-luxc/source/luxc/lang/translation/r/loop.jvm.lux2
-rw-r--r--new-luxc/source/luxc/lang/translation/r/procedure/common.jvm.lux4
-rw-r--r--new-luxc/source/luxc/lang/translation/r/reference.jvm.lux6
-rw-r--r--new-luxc/source/luxc/lang/translation/r/runtime.jvm.lux8
-rw-r--r--new-luxc/source/luxc/lang/translation/ruby.lux4
-rw-r--r--new-luxc/source/luxc/lang/translation/ruby/eval.jvm.lux4
-rw-r--r--new-luxc/source/luxc/lang/translation/ruby/function.jvm.lux8
-rw-r--r--new-luxc/source/luxc/lang/translation/ruby/loop.jvm.lux2
-rw-r--r--new-luxc/source/luxc/lang/translation/ruby/procedure/common.jvm.lux4
-rw-r--r--new-luxc/source/luxc/lang/translation/ruby/reference.jvm.lux4
-rw-r--r--new-luxc/source/luxc/lang/translation/ruby/runtime.jvm.lux2
14 files changed, 31 insertions, 31 deletions
diff --git a/new-luxc/source/luxc/lang/translation/r.lux b/new-luxc/source/luxc/lang/translation/r.lux
index 0eba35760..4864cc286 100644
--- a/new-luxc/source/luxc/lang/translation/r.lux
+++ b/new-luxc/source/luxc/lang/translation/r.lux
@@ -96,14 +96,14 @@
(function (_ compiler)
(let [old (:! Host (get@ #.host compiler))
[old-name old-sub] (get@ #context old)
- new-name (format old-name "f___" (%i (nat-to-int old-sub)))]
+ new-name (format old-name "f___" (%i (.int old-sub)))]
(case (expr (set@ #.host
(:! Nothing (set@ #context [new-name +0] old))
compiler))
(#e.Success [compiler' output])
(#e.Success [(update@ #.host
(|>> (:! Host)
- (set@ #context [old-name (n/inc old-sub)])
+ (set@ #context [old-name (inc old-sub)])
(:! Nothing))
compiler')
[new-name output]])
diff --git a/new-luxc/source/luxc/lang/translation/r/eval.jvm.lux b/new-luxc/source/luxc/lang/translation/r/eval.jvm.lux
index 66e157e40..e3a255e41 100644
--- a/new-luxc/source/luxc/lang/translation/r/eval.jvm.lux
+++ b/new-luxc/source/luxc/lang/translation/r/eval.jvm.lux
@@ -65,7 +65,7 @@
(#e.Error error)
(#e.Success lux-value)
- (recur (n/inc idx) (array.write idx (:! Any lux-value) output))))
+ (recur (inc idx) (array.write idx (:! Any lux-value) output))))
(#e.Success output)))))
(def: (parse-variant lux-object host-object)
diff --git a/new-luxc/source/luxc/lang/translation/r/function.jvm.lux b/new-luxc/source/luxc/lang/translation/r/function.jvm.lux
index 565a44909..5ecf21c3c 100644
--- a/new-luxc/source/luxc/lang/translation/r/function.jvm.lux
+++ b/new-luxc/source/luxc/lang/translation/r/function.jvm.lux
@@ -24,8 +24,8 @@
(def: $curried (r.var "curried"))
(def: (input-declaration register)
- (r.set! (referenceT.variable (n/inc register))
- (|> (@@ $curried) (r.nth (|> register n/inc nat-to-int r.int)))))
+ (r.set! (referenceT.variable (inc register))
+ (|> (@@ $curried) (r.nth (|> register inc .int r.int)))))
(def: (with-closure function-name inits function-definition)
(-> Text (List Expression) Expression (Meta Expression))
@@ -57,7 +57,7 @@
(//.with-anchor [function-name +1]
(translate bodyS))))
closureO+ (monad.map @ referenceT.translate-variable env)
- #let [arityO (|> arity nat-to-int r.int)
+ #let [arityO (|> arity .int r.int)
$num_args (r.var "num_args")
$function (r.var function-name)
var-args (r.code (format "list" (r.expression (@@ r.var-args))))
@@ -72,7 +72,7 @@
(r.cond (list [(|> (@@ $num_args) (r.= arityO))
($_ r.then
(r.set! (referenceT.variable +0) (@@ $function))
- (|> (list.n/range +0 (n/dec arity))
+ (|> (list.n/range +0 (dec arity))
(list/map input-declaration)
(list/fold r.then bodyO)))]
[(|> (@@ $num_args) (r.> arityO))
diff --git a/new-luxc/source/luxc/lang/translation/r/loop.jvm.lux b/new-luxc/source/luxc/lang/translation/r/loop.jvm.lux
index ecaf12c7c..c64973d8f 100644
--- a/new-luxc/source/luxc/lang/translation/r/loop.jvm.lux
+++ b/new-luxc/source/luxc/lang/translation/r/loop.jvm.lux
@@ -23,7 +23,7 @@
#let [$loop-name (r.var loop-name)
@loop-name (@@ $loop-name)]
_ (//.save (r.set! $loop-name
- (r.function (|> (list.n/range +0 (n/dec (list.size initsS+)))
+ (r.function (|> (list.n/range +0 (dec (list.size initsS+)))
(list/map (|>> (n/+ offset) referenceT.variable)))
bodyO)))]
(wrap (r.apply initsO+ @loop-name))))
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 582cda4c6..03cc802fc 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
@@ -58,8 +58,8 @@
(def: (wrong-arity proc expected actual)
(-> Text Nat Nat Text)
(format "Wrong number of arguments for " (%t proc) "\n"
- "Expected: " (|> expected nat-to-int %i) "\n"
- " Actual: " (|> actual nat-to-int %i)))
+ "Expected: " (|> expected .int %i) "\n"
+ " Actual: " (|> actual .int %i)))
(syntax: (arity: {name s.local-symbol} {arity s.nat})
(with-gensyms [g!_ g!proc g!name g!translate g!inputs]
diff --git a/new-luxc/source/luxc/lang/translation/r/reference.jvm.lux b/new-luxc/source/luxc/lang/translation/r/reference.jvm.lux
index e63066959..a7a788094 100644
--- a/new-luxc/source/luxc/lang/translation/r/reference.jvm.lux
+++ b/new-luxc/source/luxc/lang/translation/r/reference.jvm.lux
@@ -12,7 +12,7 @@
(do-template [<register> <translation> <prefix>]
[(def: #export (<register> register)
(-> Register SVar)
- (r.var (format <prefix> (%i (nat-to-int register)))))
+ (r.var (format <prefix> (%i (.int register)))))
(def: #export (<translation> register)
(-> Register (Meta Expression))
@@ -25,13 +25,13 @@
(-> Variable SVar)
(if (variableL.captured? var)
(closure (variableL.captured-register var))
- (variable (int-to-nat var))))
+ (variable (.nat var))))
(def: #export (translate-variable var)
(-> Variable (Meta Expression))
(if (variableL.captured? var)
(translate-captured (variableL.captured-register var))
- (translate-local (int-to-nat var))))
+ (translate-local (.nat var))))
(def: #export global
(-> Ident SVar)
diff --git a/new-luxc/source/luxc/lang/translation/r/runtime.jvm.lux b/new-luxc/source/luxc/lang/translation/r/runtime.jvm.lux
index 7cdc82064..7267494d5 100644
--- a/new-luxc/source/luxc/lang/translation/r/runtime.jvm.lux
+++ b/new-luxc/source/luxc/lang/translation/r/runtime.jvm.lux
@@ -28,17 +28,17 @@
(|> input (bit.and full-32) cap-32)
(n/> half-32 input)
- (|> post-32 (n/- input) nat-to-int (i/* -1))
+ (|> post-32 (n/- input) .int (i/* -1))
## else
- (nat-to-int input)))
+ (.int input)))
(def: high-32 (bit.logical-right-shift +32))
(def: low-32 (|>> (bit.and (hex "+FFFFFFFF"))))
(def: #export (int value)
(-> Int Expression)
- (let [value (int-to-nat value)
+ (let [value (.nat value)
high (|> value ..high-32 cap-32)
low (|> value ..low-32 cap-32)]
(r.named-list (list [//.int-high-field (r.int high)]
@@ -58,7 +58,7 @@
(def: #export (variant tag last? value)
(-> Nat Bool Expression Expression)
- (variant' (r.int (nat-to-int tag))
+ (variant' (r.int (.int tag))
(flag last?)
value))
diff --git a/new-luxc/source/luxc/lang/translation/ruby.lux b/new-luxc/source/luxc/lang/translation/ruby.lux
index c8cce4caf..808d8105c 100644
--- a/new-luxc/source/luxc/lang/translation/ruby.lux
+++ b/new-luxc/source/luxc/lang/translation/ruby.lux
@@ -82,14 +82,14 @@
(function (_ compiler)
(let [old (:! Host (get@ #.host compiler))
[old-name old-sub] (get@ #context old)
- new-name (format old-name "___" (%i (nat-to-int old-sub)))]
+ new-name (format old-name "___" (%i (.int old-sub)))]
(case (expr (set@ #.host
(:! Nothing (set@ #context [new-name +0] old))
compiler))
(#e.Success [compiler' output])
(#e.Success [(update@ #.host
(|>> (:! Host)
- (set@ #context [old-name (n/inc old-sub)])
+ (set@ #context [old-name (inc old-sub)])
(:! Nothing))
compiler')
[new-name output]])
diff --git a/new-luxc/source/luxc/lang/translation/ruby/eval.jvm.lux b/new-luxc/source/luxc/lang/translation/ruby/eval.jvm.lux
index 49bf7f1da..7d43e5460 100644
--- a/new-luxc/source/luxc/lang/translation/ruby/eval.jvm.lux
+++ b/new-luxc/source/luxc/lang/translation/ruby/eval.jvm.lux
@@ -43,7 +43,7 @@
(if (n/< size idx)
(case (RubyArray::get [(:! Int idx)] host-object)
#.None
- (recur (n/inc idx) output)
+ (recur (inc idx) output)
(#.Some value)
(case (lux-object value)
@@ -51,7 +51,7 @@
(#e.Error error)
(#e.Success lux-value)
- (recur (n/inc idx) (array.write idx lux-value output))))
+ (recur (inc idx) (array.write idx lux-value output))))
(#e.Success output)))))
(def: (variant lux-object host-object)
diff --git a/new-luxc/source/luxc/lang/translation/ruby/function.jvm.lux b/new-luxc/source/luxc/lang/translation/ruby/function.jvm.lux
index f5d64459d..aecabc914 100644
--- a/new-luxc/source/luxc/lang/translation/ruby/function.jvm.lux
+++ b/new-luxc/source/luxc/lang/translation/ruby/function.jvm.lux
@@ -23,7 +23,7 @@
(def: (input-declaration registers)
(-> (List Register) Statement)
- (ruby.set! (list.concat (list (list/map (|>> n/inc referenceT.variable) registers)
+ (ruby.set! (list.concat (list (list/map (|>> inc referenceT.variable) registers)
(list "_")))
"curried"))
@@ -51,10 +51,10 @@
(//.with-anchor [function-name +1]
(translate bodyS))))
closureO+ (monad.map @ referenceT.translate-variable env)
- #let [args-initsO+ (input-declaration (list.n/range +0 (n/dec arity)))
+ #let [args-initsO+ (input-declaration (list.n/range +0 (dec arity)))
selfO (ruby.set! (list (referenceT.variable +0)) function-name)
- arityO (|> arity nat-to-int %i)
- limitO (|> arity n/dec nat-to-int %i)]]
+ arityO (|> arity .int %i)
+ limitO (|> arity dec .int %i)]]
(wrap (with-closure closureO+
(ruby.lambda (#.Some function-name)
(list (ruby.splat "curried"))
diff --git a/new-luxc/source/luxc/lang/translation/ruby/loop.jvm.lux b/new-luxc/source/luxc/lang/translation/ruby/loop.jvm.lux
index e4da02c2a..3c2124565 100644
--- a/new-luxc/source/luxc/lang/translation/ruby/loop.jvm.lux
+++ b/new-luxc/source/luxc/lang/translation/ruby/loop.jvm.lux
@@ -20,7 +20,7 @@
initsO+ (monad.map @ translate initsS+)
bodyO (//.with-anchor [loop-name offset]
(translate bodyS))
- #let [registersO+ (|> (list.n/range +0 (n/dec (list.size initsS+)))
+ #let [registersO+ (|> (list.n/range +0 (dec (list.size initsS+)))
(list/map (|>> (n/+ offset) referenceT.variable)))]
_ (//.save (ruby.function! loop-name registersO+
(ruby.return! bodyO)))]
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 a8d4efc4a..7fb521751 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
@@ -57,8 +57,8 @@
(def: (wrong-arity proc expected actual)
(-> Text Nat Nat Text)
(format "Wrong number of arguments for " (%t proc) "\n"
- "Expected: " (|> expected nat-to-int %i) "\n"
- " Actual: " (|> actual nat-to-int %i)))
+ "Expected: " (|> expected .int %i) "\n"
+ " Actual: " (|> actual .int %i)))
(syntax: (arity: {name s.local-symbol} {arity s.nat})
(with-gensyms [g!_ g!proc g!name g!translate g!inputs]
diff --git a/new-luxc/source/luxc/lang/translation/ruby/reference.jvm.lux b/new-luxc/source/luxc/lang/translation/ruby/reference.jvm.lux
index 9612cdb7a..b778d090a 100644
--- a/new-luxc/source/luxc/lang/translation/ruby/reference.jvm.lux
+++ b/new-luxc/source/luxc/lang/translation/ruby/reference.jvm.lux
@@ -12,7 +12,7 @@
(do-template [<register> <translation> <prefix>]
[(def: #export (<register> register)
(-> Register Expression)
- (format <prefix> (%i (nat-to-int register))))
+ (format <prefix> (%i (.int register))))
(def: #export (<translation> register)
(-> Register (Meta Expression))
@@ -25,7 +25,7 @@
(-> Variable (Meta Expression))
(if (variableL.captured? var)
(translate-captured (variableL.captured-register var))
- (translate-local (int-to-nat var))))
+ (translate-local (.nat var))))
(def: #export global
(-> Ident Expression)
diff --git a/new-luxc/source/luxc/lang/translation/ruby/runtime.jvm.lux b/new-luxc/source/luxc/lang/translation/ruby/runtime.jvm.lux
index bb0549259..7e94101ff 100644
--- a/new-luxc/source/luxc/lang/translation/ruby/runtime.jvm.lux
+++ b/new-luxc/source/luxc/lang/translation/ruby/runtime.jvm.lux
@@ -30,7 +30,7 @@
(def: #export (variant tag last? value)
(-> Nat Bool Expression Expression)
- (variant' (%i (nat-to-int tag)) (flag last?) value))
+ (variant' (%i (.int tag)) (flag last?) value))
(def: #export none
Expression