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/lua/function.jvm.lux | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'new-luxc/source/luxc/lang/translation/lua/function.jvm.lux') diff --git a/new-luxc/source/luxc/lang/translation/lua/function.jvm.lux b/new-luxc/source/luxc/lang/translation/lua/function.jvm.lux index 042ddd824..02b322de6 100644 --- a/new-luxc/source/luxc/lang/translation/lua/function.jvm.lux +++ b/new-luxc/source/luxc/lang/translation/lua/function.jvm.lux @@ -23,8 +23,8 @@ (wrap (lua.apply functionO argsO+)))) (def: (input-declaration register) - (lua.local! (referenceT.variable (n/inc register)) - (#.Some (lua.nth (|> register n/inc nat-to-int %i) "curried")))) + (lua.local! (referenceT.variable (inc register)) + (#.Some (lua.nth (|> register inc .int %i) "curried")))) (def: (with-closure function-name inits function-definition) (-> Text (List Expression) Statement (Meta Expression)) @@ -55,10 +55,10 @@ (//.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)) selfO (lua.local! (referenceT.variable +0) (#.Some function-name)) - arityO (|> arity nat-to-int %i) + arityO (|> arity .int %i) pack (|>> (list) (lua.apply "table.pack"))]] (with-closure function-name closureO+ (lua.function! function-name (list "...") -- cgit v1.2.3