diff options
author | Eduardo Julian | 2020-04-18 04:10:45 -0400 |
---|---|---|
committer | Eduardo Julian | 2020-04-18 04:10:45 -0400 |
commit | 4955cfe6f248a039e95b404f26abfae04204740f (patch) | |
tree | c86f33b80a6fe944e4aff78641f91bb66103bd91 /new-luxc/source/luxc/lang/translation/jvm/function.lux | |
parent | ae72864af3e95e46a042277873d38c3006361c79 (diff) |
Generating module IDs in a similar way to artifact IDs.
Diffstat (limited to 'new-luxc/source/luxc/lang/translation/jvm/function.lux')
-rw-r--r-- | new-luxc/source/luxc/lang/translation/jvm/function.lux | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/new-luxc/source/luxc/lang/translation/jvm/function.lux b/new-luxc/source/luxc/lang/translation/jvm/function.lux index 449855aca..fa91b41df 100644 --- a/new-luxc/source/luxc/lang/translation/jvm/function.lux +++ b/new-luxc/source/luxc/lang/translation/jvm/function.lux @@ -6,6 +6,9 @@ [pipe (#+ when> new>)] ["." function]] [data + ["." product] + [text + ["%" format (#+ format)]] [number ["n" nat] ["i" int]] @@ -24,7 +27,9 @@ [lux [analysis (#+ Environment)] [synthesis (#+ Synthesis Abstraction Apply)] - ["." generation]]]]]] + ["." generation]]] + [meta + [archive (#+ Archive)]]]]] [luxc [lang [host @@ -96,10 +101,10 @@ (list.repeat amount) _.fuse)) -(def: (instance class arity env) - (-> (Type Class) Arity Environment (Operation Inst)) +(def: (instance archive class arity env) + (-> Archive (Type Class) Arity Environment (Operation Inst)) (do phase.monad - [captureI+ (monad.map @ reference.variable env) + [captureI+ (monad.map @ (reference.variable archive) env) #let [argsI (if (poly-arg? arity) (|> (nullsI (dec arity)) (list (_.int +0)) @@ -266,8 +271,8 @@ def.fuse) function.identity)) -(def: #export (with-function @begin class env arity bodyI) - (-> Label Text Environment Arity Inst +(def: #export (with-function archive @begin class env arity bodyI) + (-> Archive Label Text Environment Arity Inst (Operation [Def Inst])) (let [classD (type.class class (list)) applyD (: Def @@ -290,19 +295,19 @@ applyD ))] (do phase.monad - [instanceI (instance classD arity env)] + [instanceI (instance archive classD arity env)] (wrap [functionD instanceI])))) (def: #export (function generate archive [env arity bodyS]) (Generator Abstraction) (do phase.monad [@begin _.make-label - [function-context bodyI] (generation.with-new-context + [function-context bodyI] (generation.with-new-context archive (generation.with-anchor [@begin 1] (generate archive bodyS))) - #let [function-class (//runtime.class-name function-context)] - [functionD instanceI] (with-function @begin function-class env arity bodyI) - _ (generation.save! true ["" function-class] + #let [function-class (//.class-name function-context)] + [functionD instanceI] (with-function archive @begin function-class env arity bodyI) + _ (generation.save! true ["" (%.nat (product.right function-context))] [function-class (def.class #$.V1_6 #$.Public $.finalC function-class (list) |