From cab9451961fa25fd6683c1c7bd836941bd84e48b Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Mon, 6 Nov 2017 18:34:51 -0400 Subject: - Fixed some bugs. --- new-luxc/source/luxc/lang/translation/function.jvm.lux | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'new-luxc/source/luxc/lang/translation/function.jvm.lux') diff --git a/new-luxc/source/luxc/lang/translation/function.jvm.lux b/new-luxc/source/luxc/lang/translation/function.jvm.lux index ebdb28853..1b7f6267b 100644 --- a/new-luxc/source/luxc/lang/translation/function.jvm.lux +++ b/new-luxc/source/luxc/lang/translation/function.jvm.lux @@ -1,7 +1,8 @@ (;module: lux (lux (control [monad #+ do]) - (data text/format + (data [text] + text/format (coll [list "list/" Functor Monoid])) [meta]) (luxc ["&" base] @@ -266,13 +267,11 @@ $i;ARETURN )))) -(def: #export (with-function translate class env arity body) - (-> (-> ls;Synthesis (Meta $;Inst)) - Text (List Variable) ls;Arity ls;Synthesis +(def: #export (with-function class env arity bodyI) + (-> Text (List Variable) ls;Arity $;Inst (Meta [$;Def $;Inst])) (do meta;Monad [@begin $i;make-label - bodyI (commonT;with-function class (translate body)) #let [env-size (list;size env) applyD (: $;Def (if (poly-arg? arity) @@ -300,8 +299,10 @@ (List Variable) ls;Arity ls;Synthesis (Meta $;Inst)) (do meta;Monad - [function-class (:: @ map %code (meta;gensym "function")) - [functionD instanceI] (with-function translate function-class env arity body) + [[context bodyI] (hostL;with-sub-context + (translate body)) + #let [function-class (text;replace-all "/+" "$" context)] + [functionD instanceI] (with-function function-class env arity bodyI) _ (commonT;store-class function-class ($d;class #$;V1.6 #$;Public $;finalC function-class (list) -- cgit v1.2.3