diff options
author | Eduardo Julian | 2019-02-24 12:26:17 -0400 |
---|---|---|
committer | Eduardo Julian | 2019-02-24 12:26:17 -0400 |
commit | a72e34d30eaf3557f9b76ced9605a95759ce8eca (patch) | |
tree | 5fd88f66ac3b2b0abb5561521f806afb93c5134e /new-luxc/source/luxc/lang/translation/jvm/function.jvm.lux | |
parent | 950ac7c3311ad8ff4499164a30610fca2e57d5c9 (diff) |
Got new-luxc to compile/build again.
Diffstat (limited to 'new-luxc/source/luxc/lang/translation/jvm/function.jvm.lux')
-rw-r--r-- | new-luxc/source/luxc/lang/translation/jvm/function.jvm.lux | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/new-luxc/source/luxc/lang/translation/jvm/function.jvm.lux b/new-luxc/source/luxc/lang/translation/jvm/function.jvm.lux index 8e5fe30b3..65a66e65a 100644 --- a/new-luxc/source/luxc/lang/translation/jvm/function.jvm.lux +++ b/new-luxc/source/luxc/lang/translation/jvm/function.jvm.lux @@ -1,13 +1,15 @@ (.module: [lux (#- function) + ["." function] [control + [pipe (#+ when> new>)] ["." monad (#+ do)]] [data ["." text format] [collection - ["." list ("list/." Functor<List> Monoid<List>)]]] - [platform + ["." list ("#/." functor monoid)]]] + [tool [compiler ["_." reference (#+ Register Variable)] ["." phase @@ -75,7 +77,7 @@ (let [max-args (n/min amount runtime.num-apply-variants) later-applysI (if (n/> runtime.num-apply-variants amount) (applysI (n/+ runtime.num-apply-variants start) (n/- runtime.num-apply-variants amount)) - id)] + function.identity)] (|>> (_.CHECKCAST //.function-class) (inputsI start max-args) (_.INVOKEVIRTUAL //.function-class runtime.apply-method (runtime.apply-signature max-args) #0) @@ -106,17 +108,17 @@ (list/map (.function (_ idx) (def.field #$.Private $.finalF (reference.partial-name idx) $Object))) def.fuse) - id)) + function.identity)) (def: (instance class arity env) (-> Text Arity (List Variable) (Operation Inst)) - (do phase.Monad<Operation> + (do phase.monad [captureI+ (monad.map @ reference.variable env) #let [argsI (if (poly-arg? arity) (|> (nullsI (dec arity)) (list (_.int +0)) _.fuse) - id)]] + function.identity)]] (wrap (|>> (_.NEW class) _.DUP (_.fuse captureI+) @@ -187,7 +189,7 @@ (_.ALOAD (inc register)) (_.PUTFIELD class (reference.partial-name idx) $Object))))) _.fuse) - id)] + function.identity)] (def.method #$.Public $.noneM "<init>" (init-method env arity) (|>> (_.ALOAD 0) (function-init arity env-size) @@ -209,12 +211,12 @@ (|> (list.n/range 0 (dec stage)) (list/map (|>> reference.partial-name (load-fieldI class))) _.fuse) - id)] + function.identity)] (cond (i/= arity-over-extent (.int stage)) (|>> (_.label @label) (_.ALOAD 0) - (when (n/> 0 stage) - (_.INVOKEVIRTUAL class "reset" (reset-method class) #0)) + (when> [(new> (n/> 0 stage) [])] + [(_.INVOKEVIRTUAL class "reset" (reset-method class) #0)]) load-partialsI (inputsI 1 apply-arity) (_.INVOKEVIRTUAL class "impl" (implementation-method function-arity) #0) @@ -285,13 +287,13 @@ (with-reset class arity env) applyD ))] - (do phase.Monad<Operation> + (do phase.monad [instanceI (instance class arity env)] (wrap [functionD instanceI])))) (def: #export (function translate [env arity bodyS]) (-> Phase Abstraction (Operation Inst)) - (do phase.Monad<Operation> + (do phase.monad [@begin _.make-label [function-class bodyI] (translation.with-context (translation.with-anchor [@begin 1] @@ -314,7 +316,7 @@ (def: #export (call translate [functionS argsS]) (-> Phase Apply (Operation Inst)) - (do phase.Monad<Operation> + (do phase.monad [functionI (translate functionS) argsI (monad.map @ translate argsS) #let [applyI (|> (segment runtime.num-apply-variants argsI) |