diff options
author | Eduardo Julian | 2018-06-15 00:11:33 -0400 |
---|---|---|
committer | Eduardo Julian | 2018-06-15 00:11:33 -0400 |
commit | bcd3d9ee8f6797f758a2abea98d5cb6a74cc7df0 (patch) | |
tree | b122b9ecf2d5333ba97cffbadfeee00eba2e1cf8 /new-luxc/source/luxc/lang/translation/common-lisp | |
parent | 0190e084c6f44be32ea2bc5a89ef55b52bdc789b (diff) |
- WIP: Adjustments to new-luxc based on recent changes to stdlib.
Diffstat (limited to '')
6 files changed, 12 insertions, 12 deletions
diff --git a/new-luxc/source/luxc/lang/translation/common-lisp.lux b/new-luxc/source/luxc/lang/translation/common-lisp.lux index 1ae046d33..36926833c 100644 --- a/new-luxc/source/luxc/lang/translation/common-lisp.lux +++ b/new-luxc/source/luxc/lang/translation/common-lisp.lux @@ -94,14 +94,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/common-lisp/eval.jvm.lux b/new-luxc/source/luxc/lang/translation/common-lisp/eval.jvm.lux index eef9a985f..cb6f03d17 100644 --- a/new-luxc/source/luxc/lang/translation/common-lisp/eval.jvm.lux +++ b/new-luxc/source/luxc/lang/translation/common-lisp/eval.jvm.lux @@ -81,7 +81,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/common-lisp/function.jvm.lux b/new-luxc/source/luxc/lang/translation/common-lisp/function.jvm.lux index 543cbe899..54834b65c 100644 --- a/new-luxc/source/luxc/lang/translation/common-lisp/function.jvm.lux +++ b/new-luxc/source/luxc/lang/translation/common-lisp/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)) @@ -55,7 +55,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)]] (with-closure function-name closureO+ @@ -63,7 +63,7 @@ (_.let (list [$num_args (_.length (@@ $curried))]) (<| (_.if (|> (@@ $num_args) (_.= arityO)) (_.let (list [(referenceT.variable +0) (_.function (@@ $function))]) - (_.destructuring-bind [(|> (list.n/range +0 (n/dec arity)) + (_.destructuring-bind [(|> (list.n/range +0 (dec arity)) (list/map input-declaration) _.poly) (@@ $curried)] diff --git a/new-luxc/source/luxc/lang/translation/common-lisp/loop.jvm.lux b/new-luxc/source/luxc/lang/translation/common-lisp/loop.jvm.lux index ecaf12c7c..c64973d8f 100644 --- a/new-luxc/source/luxc/lang/translation/common-lisp/loop.jvm.lux +++ b/new-luxc/source/luxc/lang/translation/common-lisp/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/common-lisp/procedure/common.jvm.lux b/new-luxc/source/luxc/lang/translation/common-lisp/procedure/common.jvm.lux index 100e99ef8..7387c0dda 100644 --- a/new-luxc/source/luxc/lang/translation/common-lisp/procedure/common.jvm.lux +++ b/new-luxc/source/luxc/lang/translation/common-lisp/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/common-lisp/reference.jvm.lux b/new-luxc/source/luxc/lang/translation/common-lisp/reference.jvm.lux index 9de2121a1..9fd2f42ea 100644 --- a/new-luxc/source/luxc/lang/translation/common-lisp/reference.jvm.lux +++ b/new-luxc/source/luxc/lang/translation/common-lisp/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) |