diff options
author | Eduardo Julian | 2017-11-06 18:34:51 -0400 |
---|---|---|
committer | Eduardo Julian | 2017-11-06 18:34:51 -0400 |
commit | cab9451961fa25fd6683c1c7bd836941bd84e48b (patch) | |
tree | a03e681579ecc34a84881a2efd8efacea2420e9f /new-luxc/source/luxc/lang/translation/function.jvm.lux | |
parent | 4e932a33ac56bb3cb1d7b49771e770e8c373bf8e (diff) |
- Fixed some bugs.
Diffstat (limited to '')
-rw-r--r-- | new-luxc/source/luxc/lang/translation/function.jvm.lux | 15 |
1 files changed, 8 insertions, 7 deletions
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<List> Monoid<List>])) [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<Meta> [@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<Meta> - [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) |