diff options
Diffstat (limited to '')
-rw-r--r-- | lux-jvm/source/luxc/lang/translation/jvm/function.lux | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/lux-jvm/source/luxc/lang/translation/jvm/function.lux b/lux-jvm/source/luxc/lang/translation/jvm/function.lux index 9af108496..0508e9c62 100644 --- a/lux-jvm/source/luxc/lang/translation/jvm/function.lux +++ b/lux-jvm/source/luxc/lang/translation/jvm/function.lux @@ -58,9 +58,9 @@ (-> (Environment Synthesis) Arity (Type Method)) (if (poly_arg? arity) (type.method [(list) - (list.joined (list (captured_args env) - (list type.int) - (list.repeated (dec arity) //.$Value))) + (list.together (list (captured_args env) + (list type.int) + (list.repeated (-- arity) //.$Value))) type.void (list)]) (type.method [(list) (captured_args env) type.void (list)]))) @@ -80,7 +80,7 @@ (def: (inputsI start amount) (-> Register Nat Inst) - (|> (enum.range n.enum start (n.+ start (dec amount))) + (|> (enum.range n.enum start (n.+ start (-- amount))) (list@map _.ALOAD) _.fuse)) @@ -111,7 +111,7 @@ (do {@ phase.monad} [captureI+ (monad.map @ (generate archive) env) .let [argsI (if (poly_arg? arity) - (|> (nullsI (dec arity)) + (|> (nullsI (-- arity)) (list (_.int +0)) _.fuse) function.identity)]] @@ -132,12 +132,12 @@ (let [env_size (list.size env) captureI (|> (case env_size 0 (list) - _ (enum.range n.enum 0 (dec env_size))) + _ (enum.range n.enum 0 (-- env_size))) (list@map (.function (_ source) (|>> (_.ALOAD 0) (_.GETFIELD class (reference.foreign_name source) //.$Value)))) _.fuse) - argsI (|> (nullsI (dec arity)) + argsI (|> (nullsI (-- arity)) (list (_.int +0)) _.fuse)] (|>> (_.NEW class) @@ -164,20 +164,20 @@ (if (n.= 1 arity) (|>> (_.int +0) (_.INVOKESPECIAL //.$Function "<init>" function_init_method)) - (|>> (_.ILOAD (inc env_size)) + (|>> (_.ILOAD (++ env_size)) (_.INVOKESPECIAL //.$Function "<init>" function_init_method)))) (def: (with_init class env arity) (-> (Type Class) (Environment Synthesis) Arity Def) (let [env_size (list.size env) offset_partial (: (-> Nat Nat) - (|>> inc (n.+ env_size))) + (|>> ++ (n.+ env_size))) store_capturedI (|> (case env_size 0 (list) - _ (enum.range n.enum 0 (dec env_size))) + _ (enum.range n.enum 0 (-- env_size))) (list@map (.function (_ register) (|>> (_.ALOAD 0) - (_.ALOAD (inc register)) + (_.ALOAD (++ register)) (_.PUTFIELD class (reference.foreign_name register) //.$Value)))) _.fuse) store_partialI (if (poly_arg? arity) @@ -185,7 +185,7 @@ (list@map (.function (_ idx) (let [register (offset_partial idx)] (|>> (_.ALOAD 0) - (_.ALOAD (inc register)) + (_.ALOAD (++ register)) (_.PUTFIELD class (reference.partial_name idx) //.$Value))))) _.fuse) function.identity)] @@ -199,7 +199,7 @@ (def: (with_apply class env function_arity @begin bodyI apply_arity) (-> (Type Class) (Environment Synthesis) Arity Label Inst Arity Def) - (let [num_partials (dec function_arity) + (let [num_partials (-- function_arity) @default ($.new_label []) @labels (list@map $.new_label (list.repeated num_partials [])) over_extent (|> (.int function_arity) (i.- (.int apply_arity))) @@ -207,7 +207,7 @@ (list.zipped/2 (enum.range n.enum 0 num_partials)) (list@map (.function (_ [stage @label]) (let [load_partialsI (if (n.> 0 stage) - (|> (enum.range n.enum 0 (dec stage)) + (|> (enum.range n.enum 0 (-- stage)) (list@map (|>> reference.partial_name (load_fieldI class))) _.fuse) function.identity)] @@ -230,14 +230,14 @@ load_partialsI (inputsI 1 args_to_completion) (_.INVOKEVIRTUAL class "impl" (implementation_method function_arity)) - (applysI (inc args_to_completion) args_left) + (applysI (++ args_to_completion) args_left) _.ARETURN)) ... (i.< over_extent (.int stage)) (let [env_size (list.size env) load_capturedI (|> (case env_size 0 (list) - _ (enum.range n.enum 0 (dec env_size))) + _ (enum.range n.enum 0 (-- env_size))) (list@map (|>> reference.foreign_name (load_fieldI class))) _.fuse)] (|>> (_.label @label) @@ -255,7 +255,7 @@ _.fuse)] (def.method #$.Public $.noneM //runtime.apply_method (//runtime.apply_signature apply_arity) (|>> get_amount_of_partialsI - (_.TABLESWITCH +0 (|> num_partials dec .int) + (_.TABLESWITCH +0 (|> num_partials -- .int) @default @labels) casesI )))) |