From a72e34d30eaf3557f9b76ced9605a95759ce8eca Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Sun, 24 Feb 2019 12:26:17 -0400 Subject: Got new-luxc to compile/build again. --- .../luxc/lang/translation/jvm/function.jvm.lux | 28 ++++++++++++---------- 1 file changed, 15 insertions(+), 13 deletions(-) (limited to 'new-luxc/source/luxc/lang/translation/jvm/function.jvm.lux') 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 Monoid)]]] - [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 + (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-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 + (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 + (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 + (do phase.monad [functionI (translate functionS) argsI (monad.map @ translate argsS) #let [applyI (|> (segment runtime.num-apply-variants argsI) -- cgit v1.2.3