aboutsummaryrefslogtreecommitdiff
path: root/new-luxc/source/luxc/lang/translation/scheme
diff options
context:
space:
mode:
authorEduardo Julian2018-06-15 00:11:33 -0400
committerEduardo Julian2018-06-15 00:11:33 -0400
commitbcd3d9ee8f6797f758a2abea98d5cb6a74cc7df0 (patch)
treeb122b9ecf2d5333ba97cffbadfeee00eba2e1cf8 /new-luxc/source/luxc/lang/translation/scheme
parent0190e084c6f44be32ea2bc5a89ef55b52bdc789b (diff)
- WIP: Adjustments to new-luxc based on recent changes to stdlib.
Diffstat (limited to 'new-luxc/source/luxc/lang/translation/scheme')
-rw-r--r--new-luxc/source/luxc/lang/translation/scheme/eval.jvm.lux2
-rw-r--r--new-luxc/source/luxc/lang/translation/scheme/function.jvm.lux6
-rw-r--r--new-luxc/source/luxc/lang/translation/scheme/loop.jvm.lux2
-rw-r--r--new-luxc/source/luxc/lang/translation/scheme/procedure/common.jvm.lux4
-rw-r--r--new-luxc/source/luxc/lang/translation/scheme/reference.jvm.lux6
5 files changed, 10 insertions, 10 deletions
diff --git a/new-luxc/source/luxc/lang/translation/scheme/eval.jvm.lux b/new-luxc/source/luxc/lang/translation/scheme/eval.jvm.lux
index 056bf7599..362deee4a 100644
--- a/new-luxc/source/luxc/lang/translation/scheme/eval.jvm.lux
+++ b/new-luxc/source/luxc/lang/translation/scheme/eval.jvm.lux
@@ -69,7 +69,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: (variant tag flag value)
diff --git a/new-luxc/source/luxc/lang/translation/scheme/function.jvm.lux b/new-luxc/source/luxc/lang/translation/scheme/function.jvm.lux
index 0d03b31a3..87821f2a0 100644
--- a/new-luxc/source/luxc/lang/translation/scheme/function.jvm.lux
+++ b/new-luxc/source/luxc/lang/translation/scheme/function.jvm.lux
@@ -26,7 +26,7 @@
(def: $missing (_.var "missing"))
(def: input-declaration
- (|>> n/inc referenceT.variable))
+ (|>> inc referenceT.variable))
(def: (with-closure function-name inits function-definition)
(-> Text (List Expression) Expression (Meta Expression))
@@ -56,7 +56,7 @@
(//.with-anchor [function-name +1]
(translate bodyS))))
closureO+ (monad.map @ referenceT.translate-variable env)
- #let [arityO (|> arity nat-to-int _.int)
+ #let [arityO (|> arity .int _.int)
$num_args (_.var "num_args")
$function (_.var function-name)
apply-poly (function (_ args func)
@@ -66,7 +66,7 @@
(_.let (list [$num_args (_.length (@@ $curried))])
(<| (_.if (|> (@@ $num_args) (_.= arityO))
(_.let (list [(referenceT.variable +0) (@@ $function)])
- (_.let-values (list [(|> (list.n/range +0 (n/dec arity))
+ (_.let-values (list [(|> (list.n/range +0 (dec arity))
(list/map input-declaration)
_.poly)
(_.apply (_.global "apply") (list (_.global "values") (@@ $curried)))])
diff --git a/new-luxc/source/luxc/lang/translation/scheme/loop.jvm.lux b/new-luxc/source/luxc/lang/translation/scheme/loop.jvm.lux
index ecaf12c7c..c64973d8f 100644
--- a/new-luxc/source/luxc/lang/translation/scheme/loop.jvm.lux
+++ b/new-luxc/source/luxc/lang/translation/scheme/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/scheme/procedure/common.jvm.lux b/new-luxc/source/luxc/lang/translation/scheme/procedure/common.jvm.lux
index e4b6ccde5..a7e9f0814 100644
--- a/new-luxc/source/luxc/lang/translation/scheme/procedure/common.jvm.lux
+++ b/new-luxc/source/luxc/lang/translation/scheme/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/scheme/reference.jvm.lux b/new-luxc/source/luxc/lang/translation/scheme/reference.jvm.lux
index 3ee8e472a..1552f52af 100644
--- a/new-luxc/source/luxc/lang/translation/scheme/reference.jvm.lux
+++ b/new-luxc/source/luxc/lang/translation/scheme/reference.jvm.lux
@@ -12,7 +12,7 @@
(do-template [<register> <translation> <prefix>]
[(def: #export (<register> register)
(-> Register SVar)
- (_.var (format <prefix> (%i (nat-to-int register)))))
+ (_.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)