From bcd3d9ee8f6797f758a2abea98d5cb6a74cc7df0 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Fri, 15 Jun 2018 00:11:33 -0400 Subject: - WIP: Adjustments to new-luxc based on recent changes to stdlib. --- new-luxc/source/luxc/lang/translation/python/case.jvm.lux | 4 ++-- new-luxc/source/luxc/lang/translation/python/eval.jvm.lux | 2 +- new-luxc/source/luxc/lang/translation/python/function.jvm.lux | 8 ++++---- new-luxc/source/luxc/lang/translation/python/loop.jvm.lux | 2 +- .../source/luxc/lang/translation/python/procedure/common.jvm.lux | 4 ++-- new-luxc/source/luxc/lang/translation/python/reference.jvm.lux | 6 +++--- new-luxc/source/luxc/lang/translation/python/runtime.jvm.lux | 2 +- 7 files changed, 14 insertions(+), 14 deletions(-) (limited to 'new-luxc/source/luxc/lang/translation/python') diff --git a/new-luxc/source/luxc/lang/translation/python/case.jvm.lux b/new-luxc/source/luxc/lang/translation/python/case.jvm.lux index 2c32b26a6..f51acc402 100644 --- a/new-luxc/source/luxc/lang/translation/python/case.jvm.lux +++ b/new-luxc/source/luxc/lang/translation/python/case.jvm.lux @@ -191,7 +191,7 @@ (let [outer recur] (case pathP (^code ("lux case bind" (~ [_ (#.Nat register)]))) - (update@ #bindings (set.add (nat-to-int register)) + (update@ #bindings (set.add (.int register)) outer-variables) (^or (^code ("lux case seq" (~ leftP) (~ rightP))) @@ -224,7 +224,7 @@ (list/fold inner inner-variables)) (^code ("lux let" (~ [_ (#.Nat register)]) (~ inputS) (~ exprS))) - (list/fold inner (update@ #bindings (set.add (nat-to-int register)) + (list/fold inner (update@ #bindings (set.add (.int register)) inner-variables) (list inputS exprS)) diff --git a/new-luxc/source/luxc/lang/translation/python/eval.jvm.lux b/new-luxc/source/luxc/lang/translation/python/eval.jvm.lux index 6f4e43f9d..df1e7004c 100644 --- a/new-luxc/source/luxc/lang/translation/python/eval.jvm.lux +++ b/new-luxc/source/luxc/lang/translation/python/eval.jvm.lux @@ -60,7 +60,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: python-type diff --git a/new-luxc/source/luxc/lang/translation/python/function.jvm.lux b/new-luxc/source/luxc/lang/translation/python/function.jvm.lux index 97b936fc4..32522d1c0 100644 --- a/new-luxc/source/luxc/lang/translation/python/function.jvm.lux +++ b/new-luxc/source/luxc/lang/translation/python/function.jvm.lux @@ -24,8 +24,8 @@ (def: $curried (python.var "curried")) (def: (input-declaration register) - (python.set! (list (referenceT.variable (n/inc register))) - (python.nth (|> register nat-to-int python.int) + (python.set! (list (referenceT.variable (inc register))) + (python.nth (|> register .int python.int) (@@ $curried)))) (def: (with-closure function-name inits function-definition) @@ -58,14 +58,14 @@ (//.with-anchor [function-name +1] (translate bodyS)))) closureO+ (monad.map @ referenceT.translate-variable env) - #let [args-initsO+ (|> (list.n/range +0 (n/dec arity)) + #let [args-initsO+ (|> (list.n/range +0 (dec arity)) (list/map input-declaration) (case> #.Nil python.no-op! (#.Cons head tail) (list/fold python.then! head tail))) - arityO (|> arity nat-to-int python.int) + arityO (|> arity .int python.int) @curried (@@ $curried) $num_args (python.var "num_args") @num_args (@@ $num_args) diff --git a/new-luxc/source/luxc/lang/translation/python/loop.jvm.lux b/new-luxc/source/luxc/lang/translation/python/loop.jvm.lux index e490033bf..f6e3ca4c3 100644 --- a/new-luxc/source/luxc/lang/translation/python/loop.jvm.lux +++ b/new-luxc/source/luxc/lang/translation/python/loop.jvm.lux @@ -22,7 +22,7 @@ (translate bodyS)) #let [$loop-name (python.var loop-name) @loop-name (@@ $loop-name)] - _ (//.save (python.def! $loop-name (|> (list.n/range +0 (n/dec (list.size initsS+))) + _ (//.save (python.def! $loop-name (|> (list.n/range +0 (dec (list.size initsS+))) (list/map (|>> (n/+ offset) referenceT.variable))) (python.return! bodyO)))] (wrap (python.apply initsO+ @loop-name)))) diff --git a/new-luxc/source/luxc/lang/translation/python/procedure/common.jvm.lux b/new-luxc/source/luxc/lang/translation/python/procedure/common.jvm.lux index e76b369fc..6cd163210 100644 --- a/new-luxc/source/luxc/lang/translation/python/procedure/common.jvm.lux +++ b/new-luxc/source/luxc/lang/translation/python/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/python/reference.jvm.lux b/new-luxc/source/luxc/lang/translation/python/reference.jvm.lux index 1f29da34a..7cb3390f5 100644 --- a/new-luxc/source/luxc/lang/translation/python/reference.jvm.lux +++ b/new-luxc/source/luxc/lang/translation/python/reference.jvm.lux @@ -12,7 +12,7 @@ (do-template [ ] [(def: #export ( register) (-> Register SVar) - (python.var (format (%i (nat-to-int register))))) + (python.var (format (%i (.int register))))) (def: #export ( 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/python/runtime.jvm.lux b/new-luxc/source/luxc/lang/translation/python/runtime.jvm.lux index 282d7536e..fbd599c77 100644 --- a/new-luxc/source/luxc/lang/translation/python/runtime.jvm.lux +++ b/new-luxc/source/luxc/lang/translation/python/runtime.jvm.lux @@ -30,7 +30,7 @@ (def: #export (variant tag last? value) (-> Nat Bool Expression Expression) - (variant' (python.int (nat-to-int tag)) + (variant' (python.int (.int tag)) (flag last?) value)) -- cgit v1.2.3