From cd71a864ad5be13ed6ec6d046e0a2cb1087bdf94 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Fri, 10 Sep 2021 01:21:23 -0400 Subject: Migrated variants to the new syntax. --- lux-jvm/source/luxc/lang/directive/jvm.lux | 290 ++++++++++----------- lux-jvm/source/luxc/lang/host/jvm/def.lux | 4 +- lux-jvm/source/luxc/lang/host/jvm/inst.lux | 10 +- lux-jvm/source/luxc/lang/synthesis/variable.lux | 32 +-- lux-jvm/source/luxc/lang/translation/jvm.lux | 12 +- lux-jvm/source/luxc/lang/translation/jvm/case.lux | 20 +- .../source/luxc/lang/translation/jvm/common.lux | 40 +-- .../luxc/lang/translation/jvm/expression.lux | 2 +- .../luxc/lang/translation/jvm/extension/common.lux | 4 +- .../luxc/lang/translation/jvm/extension/host.lux | 88 +++---- .../source/luxc/lang/translation/jvm/function.lux | 4 +- .../source/luxc/lang/translation/jvm/reference.lux | 4 +- lux-jvm/source/program.lux | 88 +++---- lux-jvm/test/test/luxc/lang/analysis/host.jvm.lux | 46 ++-- lux-jvm/test/test/luxc/lang/synthesis/loop.lux | 24 +- .../test/test/luxc/lang/synthesis/procedure.lux | 2 +- lux-jvm/test/test/luxc/lang/translation/js.lux | 28 +- lux-jvm/test/test/luxc/lang/translation/jvm.lux | 104 ++++---- 18 files changed, 401 insertions(+), 401 deletions(-) (limited to 'lux-jvm') diff --git a/lux-jvm/source/luxc/lang/directive/jvm.lux b/lux-jvm/source/luxc/lang/directive/jvm.lux index b41e0b75f..b81a10c69 100644 --- a/lux-jvm/source/luxc/lang/directive/jvm.lux +++ b/lux-jvm/source/luxc/lang/directive/jvm.lux @@ -72,19 +72,19 @@ (def: (literal literal) (-> /.Literal Inst) (case literal - (#/.Boolean value) (_.boolean value) - (#/.Int value) (_.int value) - (#/.Long value) (_.long value) - (#/.Double value) (_.double value) - (#/.Char value) (_.char value) - (#/.String value) (_.string value))) + {#/.Boolean value} (_.boolean value) + {#/.Int value} (_.int value) + {#/.Long value} (_.long value) + {#/.Double value} (_.double value) + {#/.Char value} (_.char value) + {#/.String value} (_.string value))) (def: (constant instruction) (-> /.Constant Inst) (case instruction - (#/.BIPUSH constant) (_.BIPUSH constant) + {#/.BIPUSH constant} (_.BIPUSH constant) - (#/.SIPUSH constant) (_.SIPUSH constant) + {#/.SIPUSH constant} (_.SIPUSH constant) #/.ICONST_M1 _.ICONST_M1 #/.ICONST_0 _.ICONST_0 @@ -106,7 +106,7 @@ #/.ACONST_NULL _.NULL - (#/.LDC literal) + {#/.LDC literal} (..literal literal) )) @@ -153,16 +153,16 @@ (def: (arithmetic instruction) (-> /.Arithmetic Inst) (case instruction - (#/.Int_Arithmetic int_arithmetic) + {#/.Int_Arithmetic int_arithmetic} (..int_arithmetic int_arithmetic) - (#/.Long_Arithmetic long_arithmetic) + {#/.Long_Arithmetic long_arithmetic} (..long_arithmetic long_arithmetic) - (#/.Float_Arithmetic float_arithmetic) + {#/.Float_Arithmetic float_arithmetic} (..float_arithmetic float_arithmetic) - (#/.Double_Arithmetic double_arithmetic) + {#/.Double_Arithmetic double_arithmetic} (..double_arithmetic double_arithmetic))) (def: (int_bitwise instruction) @@ -188,10 +188,10 @@ (def: (bitwise instruction) (-> /.Bitwise Inst) (case instruction - (#/.Int_Bitwise int_bitwise) + {#/.Int_Bitwise int_bitwise} (..int_bitwise int_bitwise) - (#/.Long_Bitwise long_bitwise) + {#/.Long_Bitwise long_bitwise} (..long_bitwise long_bitwise))) (def: (conversion instruction) @@ -221,8 +221,8 @@ (case instruction #/.ARRAYLENGTH _.ARRAYLENGTH - (#/.NEWARRAY type) (_.NEWARRAY type) - (#/.ANEWARRAY type) (_.ANEWARRAY type) + {#/.NEWARRAY type} (_.NEWARRAY type) + {#/.ANEWARRAY type} (_.ANEWARRAY type) #/.BALOAD _.BALOAD #/.BASTORE _.BASTORE @@ -252,20 +252,20 @@ (-> /.Object Inst) (case instruction (^template [ ] - [( class field_name field_type) + [{ class field_name field_type} ( class field_name field_type)]) ([#/.GETSTATIC _.GETSTATIC] [#/.PUTSTATIC _.PUTSTATIC] [#/.GETFIELD _.GETFIELD] [#/.PUTFIELD _.PUTFIELD]) - (#/.NEW type) (_.NEW type) + {#/.NEW type} (_.NEW type) - (#/.INSTANCEOF type) (_.INSTANCEOF type) - (#/.CHECKCAST type) (_.CHECKCAST type) + {#/.INSTANCEOF type} (_.INSTANCEOF type) + {#/.CHECKCAST type} (_.CHECKCAST type) (^template [ ] - [( class method_name method_type) + [{ class method_name method_type} ( class method_name method_type)]) ([#/.INVOKEINTERFACE _.INVOKEINTERFACE] [#/.INVOKESPECIAL _.INVOKESPECIAL] @@ -276,42 +276,42 @@ (def: (local_int instruction) (-> /.Local_Int Inst) (case instruction - (#/.ILOAD register) (_.ILOAD register) - (#/.ISTORE register) (_.ISTORE register))) + {#/.ILOAD register} (_.ILOAD register) + {#/.ISTORE register} (_.ISTORE register))) (def: (local_long instruction) (-> /.Local_Long Inst) (case instruction - (#/.LLOAD register) (_.LLOAD register) - (#/.LSTORE register) (_.LSTORE register))) + {#/.LLOAD register} (_.LLOAD register) + {#/.LSTORE register} (_.LSTORE register))) (def: (local_float instruction) (-> /.Local_Float Inst) (case instruction - (#/.FLOAD register) (_.FLOAD register) - (#/.FSTORE register) (_.FSTORE register))) + {#/.FLOAD register} (_.FLOAD register) + {#/.FSTORE register} (_.FSTORE register))) (def: (local_double instruction) (-> /.Local_Double Inst) (case instruction - (#/.DLOAD register) (_.DLOAD register) - (#/.DSTORE register) (_.DSTORE register))) + {#/.DLOAD register} (_.DLOAD register) + {#/.DSTORE register} (_.DSTORE register))) (def: (local_object instruction) (-> /.Local_Object Inst) (case instruction - (#/.ALOAD register) (_.ALOAD register) - (#/.ASTORE register) (_.ASTORE register))) + {#/.ALOAD register} (_.ALOAD register) + {#/.ASTORE register} (_.ASTORE register))) (def: (local instruction) (-> /.Local Inst) (case instruction - (#/.Local_Int instruction) (..local_int instruction) - (#/.IINC register) (_.IINC register) - (#/.Local_Long instruction) (..local_long instruction) - (#/.Local_Float instruction) (..local_float instruction) - (#/.Local_Double instruction) (..local_double instruction) - (#/.Local_Object instruction) (..local_object instruction))) + {#/.Local_Int instruction} (..local_int instruction) + {#/.IINC register} (_.IINC register) + {#/.Local_Long instruction} (..local_long instruction) + {#/.Local_Float instruction} (..local_float instruction) + {#/.Local_Double instruction} (..local_double instruction) + {#/.Local_Object instruction} (..local_object instruction))) (def: (stack instruction) (-> /.Stack Inst) @@ -340,34 +340,34 @@ (def: (branching instruction) (-> (/.Branching org/objectweb/asm/Label) Inst) (case instruction - (#/.IF_ICMPEQ label) (_.IF_ICMPEQ label) - (#/.IF_ICMPGE label) (_.IF_ICMPGE label) - (#/.IF_ICMPGT label) (_.IF_ICMPGT label) - (#/.IF_ICMPLE label) (_.IF_ICMPLE label) - (#/.IF_ICMPLT label) (_.IF_ICMPLT label) - (#/.IF_ICMPNE label) (_.IF_ICMPNE label) - (#/.IFEQ label) (_.IFEQ label) - (#/.IFGE label) (_.IFGE label) - (#/.IFGT label) (_.IFGT label) - (#/.IFLE label) (_.IFLE label) - (#/.IFLT label) (_.IFLT label) - (#/.IFNE label) (_.IFNE label) - - (#/.TABLESWITCH min max default labels) + {#/.IF_ICMPEQ label} (_.IF_ICMPEQ label) + {#/.IF_ICMPGE label} (_.IF_ICMPGE label) + {#/.IF_ICMPGT label} (_.IF_ICMPGT label) + {#/.IF_ICMPLE label} (_.IF_ICMPLE label) + {#/.IF_ICMPLT label} (_.IF_ICMPLT label) + {#/.IF_ICMPNE label} (_.IF_ICMPNE label) + {#/.IFEQ label} (_.IFEQ label) + {#/.IFGE label} (_.IFGE label) + {#/.IFGT label} (_.IFGT label) + {#/.IFLE label} (_.IFLE label) + {#/.IFLT label} (_.IFLT label) + {#/.IFNE label} (_.IFNE label) + + {#/.TABLESWITCH min max default labels} (_.TABLESWITCH min max default labels) - (#/.LOOKUPSWITCH default keys+labels) + {#/.LOOKUPSWITCH default keys+labels} (_.LOOKUPSWITCH default keys+labels) - (#/.IF_ACMPEQ label) (_.IF_ACMPEQ label) - (#/.IF_ACMPNE label) (_.IF_ACMPNE label) - (#/.IFNONNULL label) (_.IFNONNULL label) - (#/.IFNULL label) (_.IFNULL label))) + {#/.IF_ACMPEQ label} (_.IF_ACMPEQ label) + {#/.IF_ACMPNE label} (_.IF_ACMPNE label) + {#/.IFNONNULL label} (_.IFNONNULL label) + {#/.IFNULL label} (_.IFNULL label))) (def: (exception instruction) (-> (/.Exception org/objectweb/asm/Label) Inst) (case instruction - (#/.Try start end handler exception) (_.try start end handler exception) + {#/.Try start end handler exception} (_.try start end handler exception) #/.ATHROW _.ATHROW)) (def: (concurrency instruction) @@ -389,27 +389,27 @@ (def: (control instruction) (-> (/.Control org/objectweb/asm/Label) Inst) (case instruction - (#/.GOTO label) (_.GOTO label) - (#/.Branching instruction) (..branching instruction) - (#/.Exception instruction) (..exception instruction) - (#/.Concurrency instruction) (..concurrency instruction) - (#/.Return instruction) (..return instruction))) + {#/.GOTO label} (_.GOTO label) + {#/.Branching instruction} (..branching instruction) + {#/.Exception instruction} (..exception instruction) + {#/.Concurrency instruction} (..concurrency instruction) + {#/.Return instruction} (..return instruction))) (def: (instruction instruction) (-> (/.Instruction Inst org/objectweb/asm/Label) Inst) (case instruction #/.NOP _.NOP - (#/.Constant instruction) (..constant instruction) - (#/.Arithmetic instruction) (..arithmetic instruction) - (#/.Bitwise instruction) (..bitwise instruction) - (#/.Conversion instruction) (..conversion instruction) - (#/.Array instruction) (..array instruction) - (#/.Object instruction) (..object instruction) - (#/.Local instruction) (..local instruction) - (#/.Stack instruction) (..stack instruction) - (#/.Comparison instruction) (..comparison instruction) - (#/.Control instruction) (..control instruction) - (#/.Embedded embedded) embedded)) + {#/.Constant instruction} (..constant instruction) + {#/.Arithmetic instruction} (..arithmetic instruction) + {#/.Bitwise instruction} (..bitwise instruction) + {#/.Conversion instruction} (..conversion instruction) + {#/.Array instruction} (..array instruction) + {#/.Object instruction} (..object instruction) + {#/.Local instruction} (..local instruction) + {#/.Stack instruction} (..stack instruction) + {#/.Comparison instruction} (..comparison instruction) + {#/.Control instruction} (..control instruction) + {#/.Embedded embedded} embedded)) (type: Mapping (Dictionary /.Label org/objectweb/asm/Label)) @@ -421,7 +421,7 @@ (def: (relabel [mapping label]) (Re_labeler Identity) (case (dictionary.value label mapping) - (#.Some label) + {#.Some label} [mapping label] #.None @@ -432,39 +432,39 @@ (Re_labeler /.Branching) (case instruction (^template [] - [( label) + [{ label} (let [[mapping label] (..relabel [mapping label])] - [mapping ( label)])]) + [mapping { label}])]) ([#/.IF_ICMPEQ] [#/.IF_ICMPGE] [#/.IF_ICMPGT] [#/.IF_ICMPLE] [#/.IF_ICMPLT] [#/.IF_ICMPNE] [#/.IFEQ] [#/.IFNE] [#/.IFGE] [#/.IFGT] [#/.IFLE] [#/.IFLT] [#/.IF_ACMPEQ] [#/.IF_ACMPNE] [#/.IFNONNULL] [#/.IFNULL]) - (#/.TABLESWITCH min max default labels) + {#/.TABLESWITCH min max default labels} (let [[mapping default] (..relabel [mapping default]) [mapping labels] (list\mix (function (_ input [mapping output]) (let [[mapping input] (..relabel [mapping input])] [mapping (list& input output)])) [mapping (list)] labels)] - [mapping (#/.TABLESWITCH min max default (list.reversed labels))]) + [mapping {#/.TABLESWITCH min max default (list.reversed labels)}]) - (#/.LOOKUPSWITCH default keys+labels) + {#/.LOOKUPSWITCH default keys+labels} (let [[mapping default] (..relabel [mapping default]) [mapping keys+labels] (list\mix (function (_ [expected input] [mapping output]) (let [[mapping input] (..relabel [mapping input])] [mapping (list& [expected input] output)])) [mapping (list)] keys+labels)] - [mapping (#/.LOOKUPSWITCH default (list.reversed keys+labels))]) + [mapping {#/.LOOKUPSWITCH default (list.reversed keys+labels)}]) )) (def: (relabel_exception [mapping instruction]) (Re_labeler /.Exception) (case instruction - (#/.Try start end handler exception) + {#/.Try start end handler exception} (let [[mapping start] (..relabel [mapping start]) [mapping end] (..relabel [mapping end]) [mapping handler] (..relabel [mapping handler])] - [mapping (#/.Try start end handler exception)]) + [mapping {#/.Try start end handler exception}]) #/.ATHROW [mapping #/.ATHROW] @@ -474,31 +474,31 @@ (Re_labeler /.Control) (case instruction (^template [ ] - [( instruction) + [{ instruction} (let [[mapping instruction] ( [mapping instruction])] - [mapping ( instruction)])]) + [mapping { instruction}])]) ([#/.GOTO ..relabel] [#/.Branching ..relabel_branching] [#/.Exception ..relabel_exception]) (^template [] - [( instruction) - [mapping ( instruction)]]) + [{ instruction} + [mapping { instruction}]]) ([#/.Concurrency] [#/.Return]) )) (def: (relabel_instruction [mapping instruction]) (Re_labeler (/.Instruction Inst)) (case instruction - (#/.Embedded embedded) - [mapping (#/.Embedded embedded)] + {#/.Embedded embedded} + [mapping {#/.Embedded embedded}] #/.NOP [mapping #/.NOP] (^template [] - [( instruction) - [mapping ( instruction)]]) + [{ instruction} + [mapping { instruction}]]) ([#/.Constant] [#/.Arithmetic] [#/.Bitwise] @@ -509,9 +509,9 @@ [#/.Stack] [#/.Comparison]) - (#/.Control instruction) + {#/.Control instruction} (let [[mapping instruction] (..relabel_control [mapping instruction])] - [mapping (#/.Control instruction)]))) + [mapping {#/.Control instruction}]))) (def: (relabel_bytecode [mapping bytecode]) (Re_labeler (/.Bytecode Inst)) @@ -587,10 +587,10 @@ ..Handler)) (function (_ extension_name phase archive input) (case (.result parser input) - (#try.Success input') + {#try.Success input'} (handler extension_name phase archive input') - (#try.Failure error) + {#try.Failure error} (phase.except extension.invalid_syntax [extension_name %.code input])))) (type: Declaration @@ -716,11 +716,11 @@ (type: (Method a) (Variant - (#Constructor (Constructor a)) - (#Override (Override a)) - (#Virtual (Virtual a)) - (#Static (Static a)) - (#Abstract Abstract))) + {#Constructor (Constructor a)} + {#Override (Override a)} + {#Virtual (Virtual a)} + {#Static (Static a)} + {#Abstract Abstract})) (def: constructor (Parser (Constructor Code)) @@ -843,10 +843,10 @@ (def: (header_value valueT) (-> (Type Value) Inst) (case (/type.primitive? valueT) - (#.Left classT) + {#.Left classT} _.NULL - (#.Right primitiveT) + {#.Right primitiveT} (cond (or (\ /type.equivalence = /type.boolean primitiveT) (\ /type.equivalence = /type.byte primitiveT) (\ /type.equivalence = /type.short primitiveT) @@ -866,16 +866,16 @@ (def: (header_return returnT) (-> (Type Return) Inst) (case (/type.void? returnT) - (#.Right returnT) + {#.Right returnT} _.RETURN - (#.Left valueT) + {#.Left valueT} (case (/type.primitive? valueT) - (#.Left classT) + {#.Left classT} (|>> (header_value classT) _.ARETURN) - (#.Right primitiveT) + {#.Right primitiveT} (cond (or (\ /type.equivalence = /type.boolean primitiveT) (\ /type.equivalence = /type.byte primitiveT) (\ /type.equivalence = /type.short primitiveT) @@ -911,9 +911,9 @@ (def: (method_header super_class method) (-> (Type Class) (Method Code) jvm.Def) (case method - (#Constructor [privacy strict_floating_point? annotations variables exceptions + {#Constructor [privacy strict_floating_point? annotations variables exceptions self arguments constructor_arguments - body]) + body]} (let [[super_name super_vars] (parser.read_class super_class) init_constructor_arguments (|> constructor_arguments (list\each (|>> product.left ..header_value)) @@ -933,9 +933,9 @@ (_.INVOKESPECIAL super_class ..constructor_name super_constructorT) _.RETURN))) - (#Override [[parent_name parent_variables] name strict_floating_point? annotations variables + {#Override [[parent_name parent_variables] name strict_floating_point? annotations variables self arguments return exceptions - body]) + body]} (def.method #jvm.Public (if strict_floating_point? jvm.strictM @@ -944,9 +944,9 @@ (/type.method [variables (list\each product.right arguments) return exceptions]) (..header_return return)) - (#Virtual [name privacy final? strict_floating_point? annotations variables + {#Virtual [name privacy final? strict_floating_point? annotations variables self arguments return exceptions - body]) + body]} (def.method (..visibility privacy) (|> jvm.noneM (jvm.++M (if strict_floating_point? @@ -959,9 +959,9 @@ (/type.method [variables (list\each product.right arguments) return exceptions]) (..header_return return)) - (#Static [name privacy strict_floating_point? annotations variables + {#Static [name privacy strict_floating_point? annotations variables arguments return exceptions - body]) + body]} (def.method (..visibility privacy) (|> jvm.staticM (jvm.++M (if strict_floating_point? @@ -971,7 +971,7 @@ (/type.method [variables (list\each product.right arguments) return exceptions]) (..header_return return)) - (#Abstract method) + {#Abstract method} (..abstract_method_generation method) )) @@ -1033,7 +1033,7 @@ arguments) returnT (//A.boxed_reflection_return mapping /type.void) [_scope bodyA] (|> arguments' - (#.Item [self selfT]) + {#.Item [self selfT]} list.reversed (list\mix scopeA.with_local (analyse archive bodyC)) (typeA.with_type returnT) @@ -1063,7 +1063,7 @@ arguments) returnT (//A.boxed_reflection_return mapping returnJ) [_scope bodyA] (|> arguments' - (#.Item [self selfT]) + {#.Item [self selfT]} list.reversed (list\mix scopeA.with_local (analyse archive bodyC)) (typeA.with_type returnT) @@ -1091,7 +1091,7 @@ arguments) returnT (//A.boxed_reflection_return mapping returnJ) [_scope bodyA] (|> arguments' - (#.Item [self selfT]) + {#.Item [self selfT]} list.reversed (list\mix scopeA.with_local (analyse archive bodyC)) (typeA.with_type returnT) @@ -1128,24 +1128,24 @@ (def: (method_analysis archive declaration supers method) (-> Archive Declaration (List (Type Class)) (Method Code) (Operation (Method Analysis))) (case method - (#Constructor method) + {#Constructor method} (\ phase.monad each (|>> #Constructor) (constructor_method_analysis archive declaration method)) - (#Override method) + {#Override method} (\ phase.monad each (|>> #Override) (override_method_analysis archive declaration supers method)) - (#Virtual method) + {#Virtual method} (\ phase.monad each (|>> #Virtual) (virtual_method_analysis archive declaration method)) - (#Static method) + {#Static method} (\ phase.monad each (|>> #Static) (static_method_analysis archive method)) - (#Abstract method) - (\ phase.monad in (#Abstract method)) + {#Abstract method} + (\ phase.monad in {#Abstract method}) )) (template: (method_body ) @@ -1168,7 +1168,7 @@ (\ ! each (|>> [typeJ]) (synthesise archive termA))) constructor_argumentsA) - bodyS (synthesise archive (#analysis.Function (list) (//A.hide_method_body (list.size arguments) bodyA)))] + bodyS (synthesise archive {#analysis.Function (list) (//A.hide_method_body (list.size arguments) bodyA)})] (in [privacy strict_floating_point? annotations method_tvars exceptions self arguments constructor_argumentsS (case bodyS @@ -1187,7 +1187,7 @@ synthesise directive.synthesis] (directive.lifted_synthesis (do ! - [bodyS (synthesise archive (#analysis.Function (list) (//A.hide_method_body (list.size arguments) bodyA)))] + [bodyS (synthesise archive {#analysis.Function (list) (//A.hide_method_body (list.size arguments) bodyA)})] (in [[super_name super_tvars] method_name strict_floating_point? annotations method_tvars self arguments returnJ exceptionsJ (case bodyS @@ -1206,7 +1206,7 @@ synthesise directive.synthesis] (directive.lifted_synthesis (do ! - [bodyS (synthesise archive (#analysis.Function (list) (//A.hide_method_body (list.size arguments) bodyA)))] + [bodyS (synthesise archive {#analysis.Function (list) (//A.hide_method_body (list.size arguments) bodyA)})] (in [name privacy final? strict_floating_point? annotations method_tvars self arguments returnJ exceptionsJ (case bodyS @@ -1225,7 +1225,7 @@ synthesise directive.synthesis] (directive.lifted_synthesis (do ! - [bodyS (synthesise archive (#analysis.Function (list) (//A.hide_method_body (list.size arguments) bodyA)))] + [bodyS (synthesise archive {#analysis.Function (list) (//A.hide_method_body (list.size arguments) bodyA)})] (in [name privacy strict_floating_point? annotations method_tvars arguments returnJ exceptionsJ (case bodyS @@ -1238,24 +1238,24 @@ (def: (method_synthesis archive method) (-> Archive (Method Analysis) (Operation (Method Synthesis))) (case method - (#Constructor method) + {#Constructor method} (\ phase.monad each (|>> #Constructor) (constructor_method_synthesis archive method)) - (#Override method) + {#Override method} (\ phase.monad each (|>> #Override) (override_method_synthesis archive method)) - (#Virtual method) + {#Virtual method} (\ phase.monad each (|>> #Virtual) (virtual_method_synthesis archive method)) - (#Static method) + {#Static method} (\ phase.monad each (|>> #Static) (static_method_synthesis archive method)) - (#Abstract method) - (\ phase.monad in (#Abstract method)) + {#Abstract method} + (\ phase.monad in {#Abstract method}) )) (def: (constructor_method_generation archive super_class method) @@ -1363,19 +1363,19 @@ (def: (method_generation archive super_class method) (-> Archive (Type Class) (Method Synthesis) (Operation jvm.Def)) (case method - (#Constructor method) + {#Constructor method} (..constructor_method_generation archive super_class method) - (#Override method) + {#Override method} (..override_method_generation archive method) - (#Virtual method) + {#Virtual method} (..virtual_method_generation archive method) - (#Static method) + {#Static method} (..static_method_generation archive method) - (#Abstract method) + {#Abstract method} (\ phase.monad in (..abstract_method_generation method)) )) @@ -1384,13 +1384,13 @@ (def: (convert_overriden_method method) (-> (Method Code) (Maybe (//A.Overriden_Method Code))) (case method - (#Override [[parent_name parent_variables] method_name strict_floating_point? annotations variables + {#Override [[parent_name parent_variables] method_name strict_floating_point? annotations variables self arguments return exceptions - body]) - (#.Some [(/type.class parent_name parent_variables) method_name + body]} + {#.Some [(/type.class parent_name parent_variables) method_name strict_floating_point? (list) variables self arguments return exceptions - body]) + body]} _ #.None)) @@ -1445,7 +1445,7 @@ (do ! [artifact_id (generation.learn_custom class_name) _ (generation.execute! directive) - _ (generation.save! artifact_id (#.Some class_name) directive) + _ (generation.save! artifact_id {#.Some class_name} directive) _ (generation.log! (format "JVM Class " (%.text class_name)))] (in directive.no_requirements)))))])) @@ -1472,7 +1472,7 @@ (do ! [artifact_id (generation.learn_custom class_name) _ (generation.execute! directive) - _ (generation.save! artifact_id (#.Some class_name) directive) + _ (generation.save! artifact_id {#.Some class_name} directive) _ (generation.log! (format "JVM Interface " (%.text class_name)))] (in directive.no_requirements)))))])) diff --git a/lux-jvm/source/luxc/lang/host/jvm/def.lux b/lux-jvm/source/luxc/lang/host/jvm/def.lux index 36aed2d61..ecafc00d2 100644 --- a/lux-jvm/source/luxc/lang/host/jvm/def.lux +++ b/lux-jvm/source/luxc/lang/host/jvm/def.lux @@ -296,8 +296,8 @@ #.End function.identity - (#.Item singleton #.End) + {#.Item singleton #.End} singleton - (#.Item head tail) + {#.Item head tail} (function.composite (fuse tail) head))) diff --git a/lux-jvm/source/luxc/lang/host/jvm/inst.lux b/lux-jvm/source/luxc/lang/host/jvm/inst.lux index 2255774f8..bbeffb023 100644 --- a/lux-jvm/source/luxc/lang/host/jvm/inst.lux +++ b/lux-jvm/source/luxc/lang/host/jvm/inst.lux @@ -152,7 +152,7 @@ (def: .public make_label (All (_ s) (Operation s org/objectweb/asm/Label)) (function (_ state) - (#try.Success [state (org/objectweb/asm/Label::new)]))) + {#try.Success [state (org/objectweb/asm/Label::new)]})) (def: .public (with_label action) (All (_ a) (-> (-> org/objectweb/asm/Label a) a)) @@ -414,10 +414,10 @@ (def: .public (array elementT) (-> (Type Value) Inst) (case (type.primitive? elementT) - (#.Left elementT) + {#.Left elementT} (ANEWARRAY elementT) - (#.Right elementT) + {#.Right elementT} (NEWARRAY elementT))) (template [ ] @@ -462,8 +462,8 @@ #.End function.identity - (#.Item singleton #.End) + {#.Item singleton #.End} singleton - (#.Item head tail) + {#.Item head tail} (function.composite (fuse tail) head))) diff --git a/lux-jvm/source/luxc/lang/synthesis/variable.lux b/lux-jvm/source/luxc/lang/synthesis/variable.lux index 12594e154..685eaae92 100644 --- a/lux-jvm/source/luxc/lang/synthesis/variable.lux +++ b/lux-jvm/source/luxc/lang/synthesis/variable.lux @@ -11,10 +11,10 @@ (def: (bound-vars path) (-> ls.Path (List Variable)) (case path - (#ls.BindP register) + {#ls.BindP register} (list (.int register)) - (^or (#ls.SeqP pre post) (#ls.AltP pre post)) + (^or {#ls.SeqP pre post} {#ls.AltP pre post}) (list/composite (bound-vars pre) (bound-vars post)) _ @@ -23,13 +23,13 @@ (def: (path-bodies path) (-> ls.Path (List ls.Synthesis)) (case path - (#ls.ExecP body) + {#ls.ExecP body} (list body) - (#ls.SeqP pre post) + {#ls.SeqP pre post} (path-bodies post) - (#ls.AltP pre post) + {#ls.AltP pre post} (list/composite (path-bodies pre) (path-bodies post)) _ @@ -49,40 +49,40 @@ (let [tracker (loop [exprS exprS tracker (list/mix s.has init-tracker bound)] (case exprS - (#ls.Variable var) + {#ls.Variable var} (if (non-arg? current-arity var) (s.lacks var tracker) tracker) - (#ls.Variant tag last? memberS) + {#ls.Variant tag last? memberS} (recur memberS tracker) - (#ls.Tuple membersS) + {#ls.Tuple membersS} (list/mix recur tracker membersS) - (#ls.Call funcS argsS) + {#ls.Call funcS argsS} (list/mix recur (recur funcS tracker) argsS) - (^or (#ls.Recur argsS) - (#ls.Procedure name argsS)) + (^or {#ls.Recur argsS} + {#ls.Procedure name argsS}) (list/mix recur tracker argsS) - (#ls.Let offset inputS outputS) + {#ls.Let offset inputS outputS} (|> tracker (recur inputS) (recur outputS)) - (#ls.If testS thenS elseS) + {#ls.If testS thenS elseS} (|> tracker (recur testS) (recur thenS) (recur elseS)) - (#ls.Loop offset initsS bodyS) + {#ls.Loop offset initsS bodyS} (recur bodyS (list/mix recur tracker initsS)) - (#ls.Case inputS outputPS) + {#ls.Case inputS outputPS} (let [tracker' (list/mix s.has (recur inputS tracker) (bound-vars outputPS))] (list/mix recur tracker' (path-bodies outputPS))) - (#ls.Function arity env bodyS) + {#ls.Function arity env bodyS} (list/mix s.lacks tracker env) _ diff --git a/lux-jvm/source/luxc/lang/translation/jvm.lux b/lux-jvm/source/luxc/lang/translation/jvm.lux index db7b5b3fa..6a641f0ee 100644 --- a/lux-jvm/source/luxc/lang/translation/jvm.lux +++ b/lux-jvm/source/luxc/lang/translation/jvm.lux @@ -83,20 +83,20 @@ (def: (class_value class_name class) (-> Text (java/lang/Class java/lang/Object) (Try Any)) (case (java/lang/Class::getField ..value_field class) - (#try.Success field) + {#try.Success field} (case (java/lang/reflect/Field::get #.None field) - (#try.Success ?value) + {#try.Success ?value} (case ?value - (#.Some value) - (#try.Success value) + {#.Some value} + {#try.Success value} #.None (exception.except ..invalid_value class_name)) - (#try.Failure error) + {#try.Failure error} (exception.except ..cannot_load [class_name error])) - (#try.Failure error) + {#try.Failure error} (exception.except ..invalid_field [class_name ..value_field error]))) (def: class_path_separator ".") diff --git a/lux-jvm/source/luxc/lang/translation/jvm/case.lux b/lux-jvm/source/luxc/lang/translation/jvm/case.lux index a6d0a725f..0959130a3 100644 --- a/lux-jvm/source/luxc/lang/translation/jvm/case.lux +++ b/lux-jvm/source/luxc/lang/translation/jvm/case.lux @@ -106,15 +106,15 @@ #synthesis.Pop (operation@in ..popI) - (#synthesis.Bind register) + {#synthesis.Bind register} (operation@in (|>> peekI (_.ASTORE register))) - (#synthesis.Bit_Fork when thenP elseP) + {#synthesis.Bit_Fork when thenP elseP} (do phase.monad [thenG (path' stack_depth @else @end phase archive thenP) elseG (.case elseP - (#.Some elseP) + {#.Some elseP} (path' stack_depth @else @end phase archive elseP) #.None @@ -129,7 +129,7 @@ elseG)))) (^template [ ] - [( cons) + [{ cons} (do [@ phase.monad] [forkG (: (Operation Inst) (monad.mix @ (function (_ [test thenP] elseG) @@ -146,7 +146,7 @@ elseG))))) (|>> (_.GOTO @else)) - (#.Item cons)))] + {#.Item cons}))] (in (|>> peekI forkG)))]) @@ -156,7 +156,7 @@ (_.INVOKEVIRTUAL (type.class "java.lang.Object" (list)) "equals" ..equalsJT) _.IFEQ]) - (#synthesis.Then bodyS) + {#synthesis.Then bodyS} (do phase.monad [bodyI (phase archive bodyS)] (in (|>> (pop_altI stack_depth) @@ -202,14 +202,14 @@ ([synthesis.member/left ..left_projection] [synthesis.member/right ..right_projection]) - (#synthesis.Seq leftP rightP) + {#synthesis.Seq leftP rightP} (do phase.monad [leftI (path' stack_depth @else @end phase archive leftP) rightI (path' stack_depth @else @end phase archive rightP)] (in (|>> leftI rightI))) - (#synthesis.Alt leftP rightP) + {#synthesis.Alt leftP rightP} (do phase.monad [@alt_else _.make_label leftI (path' (++ stack_depth) @alt_else @end phase archive leftP) @@ -268,10 +268,10 @@ [recordG (phase archive recordS)] (in (list@mix (function (_ step so_far) (.let [next (.case step - (#.Left lefts) + {#.Left lefts} (..left_projection lefts) - (#.Right lefts) + {#.Right lefts} (..right_projection lefts))] (|>> so_far next))) recordG diff --git a/lux-jvm/source/luxc/lang/translation/jvm/common.lux b/lux-jvm/source/luxc/lang/translation/jvm/common.lux index 8db12bd7e..2dade7a97 100644 --- a/lux-jvm/source/luxc/lang/translation/jvm/common.lux +++ b/lux-jvm/source/luxc/lang/translation/jvm/common.lux @@ -32,21 +32,21 @@ ... (All (_ a) (-> (Meta a) (Meta [Artifacts a]))) ... (function (_ state) ... (case (action (revised@ #.host -... (|>> (:coerce Host) -... (with@ #artifacts (dictionary.new text.hash)) -... (:coerce Nothing)) -... state)) -... (#try.Success [state' output]) -... (#try.Success [(revised@ #.host -... (|>> (:coerce Host) -... (with@ #artifacts (|> (value@ #.host state) (:coerce Host) (value@ #artifacts))) -... (:coerce Nothing)) -... state') -... [(|> state' (value@ #.host) (:coerce Host) (value@ #artifacts)) -... output]]) +... (|>> (:coerce Host) +... (with@ #artifacts (dictionary.new text.hash)) +... (:coerce Nothing)) +... state)) +... {#try.Success [state' output]} +... {#try.Success [(revised@ #.host +... (|>> (:coerce Host) +... (with@ #artifacts (|> (value@ #.host state) (:coerce Host) (value@ #artifacts))) +... (:coerce Nothing)) +... state') +... [(|> state' (value@ #.host) (:coerce Host) (value@ #artifacts)) +... output]]} -... (#try.Failure error) -... (#try.Failure error)))) +... {#try.Failure error} +... {#try.Failure error}))) ... (def: .public (load-definition state) ... (-> Lux (-> Name Binary (Try Any))) @@ -60,14 +60,14 @@ ... (case (do try.monad ... [field (Class::getField [..value-field] class)] ... (Field::get [#.None] field)) -... (#try.Success (#.Some def-value)) +... {#try.Success {#.Some def-value}} ... (wrap def-value) -... (#try.Success #.None) +... {#try.Success #.None} ... (phase.throw invalid-definition-value (%name def-name)) -... (#try.Failure error) +... {#try.Failure error} ... (phase.throw cannot-load-definition -... (format "Definition: " (%name def-name) "\n" -... "Error:\n" -... error)))))))) +... (format "Definition: " (%name def-name) "\n" +... "Error:\n" +... error)))))))) diff --git a/lux-jvm/source/luxc/lang/translation/jvm/expression.lux b/lux-jvm/source/luxc/lang/translation/jvm/expression.lux index 087ebfaff..a460ad96b 100644 --- a/lux-jvm/source/luxc/lang/translation/jvm/expression.lux +++ b/lux-jvm/source/luxc/lang/translation/jvm/expression.lux @@ -72,5 +72,5 @@ (^ (synthesis.function/abstraction data)) (function.function translate archive data) - (#synthesis.Extension extension) + {#synthesis.Extension extension} (extension.apply archive translate extension))) diff --git a/lux-jvm/source/luxc/lang/translation/jvm/extension/common.lux b/lux-jvm/source/luxc/lang/translation/jvm/extension/common.lux index e3ac4141b..8d92a68eb 100644 --- a/lux-jvm/source/luxc/lang/translation/jvm/extension/common.lux +++ b/lux-jvm/source/luxc/lang/translation/jvm/extension/common.lux @@ -48,10 +48,10 @@ Handler)) (function (_ extension_name phase archive input) (case (.result parser input) - (#try.Success input') + {#try.Success input'} (handler extension_name phase archive input') - (#try.Failure error) + {#try.Failure error} (phase.except extension.invalid_syntax [extension_name %synthesis input])))) (import: java/lang/Double diff --git a/lux-jvm/source/luxc/lang/translation/jvm/extension/host.lux b/lux-jvm/source/luxc/lang/translation/jvm/extension/host.lux index 131ff0968..8535c3b35 100644 --- a/lux-jvm/source/luxc/lang/translation/jvm/extension/host.lux +++ b/lux-jvm/source/luxc/lang/translation/jvm/extension/host.lux @@ -96,9 +96,9 @@ (do <>.monad [arrayJT (.then parser.array .text)] (case (parser.array? arrayJT) - (#.Some elementJT) + {#.Some elementJT} (case (parser.object? elementJT) - (#.Some elementJT) + {#.Some elementJT} (in elementJT) #.None @@ -629,7 +629,7 @@ (do phase.monad [] (case (dictionary.value unboxed ..primitives) - (#.Some primitive) + {#.Some primitive} (in (_.GETSTATIC (type.class class (list)) field primitive)) #.None @@ -644,7 +644,7 @@ [valueI (generate archive valueS) .let [$class (type.class class (list))]] (case (dictionary.value unboxed ..primitives) - (#.Some primitive) + {#.Some primitive} (in (|>> valueI (_.PUTSTATIC $class field primitive) (_.string synthesis.unit))) @@ -664,7 +664,7 @@ [objectI (generate archive objectS) .let [$class (type.class class (list)) getI (case (dictionary.value unboxed ..primitives) - (#.Some primitive) + {#.Some primitive} (_.GETFIELD $class field primitive) #.None @@ -683,7 +683,7 @@ objectI (generate archive objectS) .let [$class (type.class class (list)) putI (case (dictionary.value unboxed ..primitives) - (#.Some primitive) + {#.Some primitive} (_.PUTFIELD $class field primitive) #.None @@ -709,10 +709,10 @@ (do phase.monad [valueI (generate archive valueS)] (case (type.primitive? valueT) - (#.Right valueT) + {#.Right valueT} (in [valueT valueI]) - (#.Left valueT) + {#.Left valueT} (in [valueT (|>> valueI (_.CHECKCAST valueT))])))) @@ -722,10 +722,10 @@ (def: (prepare_output outputT) (-> (Type Return) Inst) (case (type.void? outputT) - (#.Right outputT) + {#.Right outputT} ..voidI - (#.Left outputT) + {#.Left outputT} function.identity)) (def: invoke::static @@ -814,26 +814,26 @@ [0 _] body [1 _] body - [2 (#synthesis.Control (#synthesis.Branch (#synthesis.Let _ 2 hidden)))] + [2 {#synthesis.Control {#synthesis.Branch {#synthesis.Let _ 2 hidden}}}] hidden - [_ (#synthesis.Control (#synthesis.Branch (#synthesis.Case _ path)))] + [_ {#synthesis.Control {#synthesis.Branch {#synthesis.Case _ path}}}] (loop [path path] (case path (^or #synthesis.Pop - (#synthesis.Access _) - (#synthesis.Bind _) - (#synthesis.Bit_Fork _) - (#synthesis.I64_Fork _) - (#synthesis.F64_Fork _) - (#synthesis.Text_Fork _) - (#synthesis.Alt _)) + {#synthesis.Access _} + {#synthesis.Bind _} + {#synthesis.Bit_Fork _} + {#synthesis.I64_Fork _} + {#synthesis.F64_Fork _} + {#synthesis.Text_Fork _} + {#synthesis.Alt _}) body - (#synthesis.Seq _ next) + {#synthesis.Seq _ next} (recur next) - (#synthesis.Then hidden) + {#synthesis.Then hidden} hidden)) _ @@ -873,27 +873,27 @@ (synthesis.path/then (normalize bodyS)) (^template [] - [(^ ( leftP rightP)) - ( (recur leftP) (recur rightP))]) + [(^ { leftP rightP}) + { (recur leftP) (recur rightP)}]) ([#synthesis.Alt] [#synthesis.Seq]) (^template [] - [(^ ( value)) + [(^ { value}) path]) ([#synthesis.Pop] [#synthesis.Bind] [#synthesis.Access]) - (#synthesis.Bit_Fork when then else) - (#synthesis.Bit_Fork when (recur then) (maybe\each recur else)) + {#synthesis.Bit_Fork when then else} + {#synthesis.Bit_Fork when (recur then) (maybe\each recur else)} (^template [] - [( [[test then] elses]) - ( [[test (recur then)] + [{ [[test then] elses]} + { [[test (recur then)] (list\each (function (_ [else_test else_then]) [else_test (recur else_then)]) - elses)])]) + elses)]}]) ([#synthesis.I64_Fork] [#synthesis.F64_Fork] [#synthesis.Text_Fork]) @@ -903,11 +903,11 @@ (-> (Dictionary Synthesis Variable) Synthesis Synthesis) (function (recur body) (case body - (^template [] - [(^ ( value)) - body]) - ([#synthesis.Primitive] - [synthesis.constant]) + (^ {#synthesis.Primitive value}) + body + + (^ {synthesis.constant value}) + body (^ (synthesis.variant [lefts right? sub])) (synthesis.variant [lefts right? (recur sub)]) @@ -957,8 +957,8 @@ (^ (synthesis.function/apply [functionS inputsS+])) (synthesis.function/apply [(recur functionS) (list\each recur inputsS+)]) - (#synthesis.Extension [name inputsS+]) - (#synthesis.Extension [name (list\each recur inputsS+)])))) + {#synthesis.Extension [name inputsS+]} + {#synthesis.Extension [name (list\each recur inputsS+)]}))) (def: $Object (type.class "java.lang.Object" (list))) @@ -999,14 +999,14 @@ (def: (prepare_argument lux_register argumentT jvm_register) (-> Register (Type Value) Register [Register Inst]) (case (type.primitive? argumentT) - (#.Left argumentT) + {#.Left argumentT} [(n.+ 1 jvm_register) (if (n.= lux_register jvm_register) (|>>) (|>> (_.ALOAD jvm_register) (_.ASTORE lux_register)))] - (#.Right argumentT) + {#.Right argumentT} (template.let [(wrap_primitive ) [[(n.+ jvm_register) (|>> ( jvm_register) @@ -1040,21 +1040,21 @@ (def: .public (returnI returnT) (-> (Type Return) Inst) (case (type.void? returnT) - (#.Right returnT) + {#.Right returnT} _.RETURN - (#.Left returnT) + {#.Left returnT} (case (type.primitive? returnT) - (#.Left returnT) + {#.Left returnT} (case (type.class? returnT) - (#.Some class_name) + {#.Some class_name} (|>> (_.CHECKCAST returnT) _.ARETURN) #.None _.ARETURN) - (#.Right returnT) + {#.Right returnT} (template.let [(unwrap_primitive ) [(|>> (_.unwrap ) )]] @@ -1102,7 +1102,7 @@ ... Give them names as "foreign" variables. list.enumeration (list\each (function (_ [id capture]) - [capture (#variable.Foreign id)])) + [capture {#variable.Foreign id}])) (dictionary.of_list synthesis.hash)) normalized_methods (list\each (function (_ [environment [ownerT name diff --git a/lux-jvm/source/luxc/lang/translation/jvm/function.lux b/lux-jvm/source/luxc/lang/translation/jvm/function.lux index 2a202fbcd..7630191e9 100644 --- a/lux-jvm/source/luxc/lang/translation/jvm/function.lux +++ b/lux-jvm/source/luxc/lang/translation/jvm/function.lux @@ -308,7 +308,7 @@ (do [! phase.monad] [@begin _.make_label [function_context bodyI] (case forced_context - (#.Some function_context) + {#.Some function_context} (do ! [without_context (generation.with_anchor [@begin 1] (generate archive bodyS))] @@ -331,7 +331,7 @@ #.None (generation.save! (product.right function_context) #.None directive) - (#.Some function_context) + {#.Some function_context} (in []))] (in instanceI))) diff --git a/lux-jvm/source/luxc/lang/translation/jvm/reference.lux b/lux-jvm/source/luxc/lang/translation/jvm/reference.lux index 9b0feeb78..3c76f44c0 100644 --- a/lux-jvm/source/luxc/lang/translation/jvm/reference.lux +++ b/lux-jvm/source/luxc/lang/translation/jvm/reference.lux @@ -53,10 +53,10 @@ (def: .public (variable archive variable) (-> Archive Variable (Operation Inst)) (case variable - (#variable.Local variable) + {#variable.Local variable} (operation@in (local variable)) - (#variable.Foreign variable) + {#variable.Foreign variable} (foreign archive variable))) (def: .public (constant archive name) diff --git a/lux-jvm/source/program.lux b/lux-jvm/source/program.lux index b2319af7e..e3244f410 100644 --- a/lux-jvm/source/program.lux +++ b/lux-jvm/source/program.lux @@ -144,73 +144,73 @@ unwrap_long (: (-> Synthesis Synthesis) (|>> (list ($.text jvm/type/box.long) ($.text "long")) - (#$.Extension "jvm object cast"))) + {#$.Extension "jvm object cast"})) long_to_int (: (-> Synthesis Synthesis) (|>> (list) - (#$.Extension "jvm conversion long-to-int"))) + {#$.Extension "jvm conversion long-to-int"})) literal_nat (: (-> Nat Synthesis) (|>> .i64 $.i64 unwrap_long long_to_int)) write! (: (-> Text Nat Synthesis Synthesis Synthesis) (function (_ element_class index value array) - ((#$.Extension "jvm array write object" - (list (jvm_type (jvm/type.array (jvm/type.class element_class (list)))) - (literal_nat index) - value - array))))) + ({#$.Extension "jvm array write object" + (list (jvm_type (jvm/type.array (jvm/type.class element_class (list)))) + (literal_nat index) + value + array)}))) object_array (: (-> Text Nat Synthesis) (function (_ class_name size) - (#$.Extension "jvm array new object" - (list (class_type class_name) - (literal_nat size))))) + {#$.Extension "jvm array new object" + (list (class_type class_name) + (literal_nat size))})) class_of (: (-> Synthesis Synthesis) (function (_ object) - (#$.Extension "jvm member invoke virtual" - (list& (class_type "java.lang.Object") - ($.text "getClass") - (class_type "java.lang.Class") - object - (list))))) + {#$.Extension "jvm member invoke virtual" + (list& (class_type "java.lang.Object") + ($.text "getClass") + (class_type "java.lang.Class") + object + (list))})) input (: (All (_ c) (-> (jvm/type.Type c) Synthesis Synthesis)) (function (_ value_type value) ($.tuple (list (jvm_type value_type) value)))) - example_object (#$.Extension "jvm member invoke constructor" - (list& (class_type "java.lang.Object") - (list))) + example_object {#$.Extension "jvm member invoke constructor" + (list& (class_type "java.lang.Object") + (list))} phase_arity 3 $phase ($.variable/local 1) $archive ($.variable/local 2) $input ($.variable/local 3) $state ($.variable/local 4) - apply_method (#$.Extension "jvm member invoke virtual" - (list& (class_type "java.lang.Class") - ($.text "getMethod") - (class_type "java.lang.reflect.Method") - (class_of $phase) - (list (input java/lang/String - ($.text runtime.apply_method)) - (input - (|> (object_array "java.lang.Class" phase_arity) - (write! "java.lang.Class" 0 (class_of example_object)) - (write! "java.lang.Class" 1 (class_of example_object)) - (write! "java.lang.Class" 2 (class_of example_object)))))))] - (#$.Extension "jvm member invoke virtual" - (list& (class_type "java.lang.reflect.Method") - ($.text "invoke") - (class_type "java.lang.Object") - apply_method - (list (input java/lang/Object - $phase) - (input - (|> (object_array "java.lang.Object" phase_arity) - (write! "java.lang.Object" 0 $archive) - (write! "java.lang.Object" 1 $input) - (write! "java.lang.Object" 2 $state)))))))) + apply_method {#$.Extension "jvm member invoke virtual" + (list& (class_type "java.lang.Class") + ($.text "getMethod") + (class_type "java.lang.reflect.Method") + (class_of $phase) + (list (input java/lang/String + ($.text runtime.apply_method)) + (input + (|> (object_array "java.lang.Class" phase_arity) + (write! "java.lang.Class" 0 (class_of example_object)) + (write! "java.lang.Class" 1 (class_of example_object)) + (write! "java.lang.Class" 2 (class_of example_object))))))}] + {#$.Extension "jvm member invoke virtual" + (list& (class_type "java.lang.reflect.Method") + ($.text "invoke") + (class_type "java.lang.Object") + apply_method + (list (input java/lang/Object + $phase) + (input + (|> (object_array "java.lang.Object" phase_arity) + (write! "java.lang.Object" 0 $archive) + (write! "java.lang.Object" 1 $input) + (write! "java.lang.Object" 2 $state)))))})) (def: (phase_wrapper archive) (-> Archive (generation.Operation _.Anchor _.Inst _.Definition phase.Wrapper)) (do phase.monad - [instanceG (function.function' (#.Some [0 (.nat -1)]) expression.translate archive [(list) 4 ..how_to_wrap_a_phase]) + [instanceG (function.function' {#.Some [0 (.nat -1)]} expression.translate archive [(list) 4 ..how_to_wrap_a_phase]) phase_wrapper (generation.evaluate! [0 (.nat -2)] instanceG)] (in (function (_ phase) (<| try.trusted diff --git a/lux-jvm/test/test/luxc/lang/analysis/host.jvm.lux b/lux-jvm/test/test/luxc/lang/analysis/host.jvm.lux index ef12fcf25..81328faec 100644 --- a/lux-jvm/test/test/luxc/lang/analysis/host.jvm.lux +++ b/lux-jvm/test/test/luxc/lang/analysis/host.jvm.lux @@ -42,10 +42,10 @@ (_primitive.analyse (` ((~ (code.text procedure)) (~+ params))))))) (analysis.with-current-module "") (macro.result (initL.compiler [])) - (case> (#e.Success _) + (case> {#e.Success _} - (#e.Error error) + {#e.Error error} )))] [success #1 #0] @@ -63,10 +63,10 @@ (_primitive.analyse syntax)))) (analysis.with-current-module "") (macro.result (initL.compiler [])) - (case> (#e.Success _) + (case> {#e.Success _} - (#e.Error error) + {#e.Error error} )))] [success' #1 #0] @@ -281,14 +281,14 @@ size (|> r.nat (:: @ each cap)) idx (|> r.nat (:: @ each (n/% size))) level (|> r.nat (:: @ each cap)) - #let [unboxedT (#.Primitive unboxed (list)) - arrayT (#.Primitive "#Array" (list unboxedT)) + #let [unboxedT {#.Primitive unboxed (list)} + arrayT {#.Primitive "#Array" (list unboxedT)} arrayC (`' ("lux check" (+0 "#Array" (+1 (+0 (~ (code.text unboxed)) (+0)) (+0))) ("jvm array new" (~ (code.nat size))))) - boxedT (#.Primitive boxed (list)) + boxedT {#.Primitive boxed (list)} boxedTC (` (+0 (~ (code.text boxed)) (+0))) multi-arrayT (list/mix (function (_ _ innerT) - (|> innerT (list) (#.Primitive "#Array"))) + (|> innerT (list) {#.Primitive "#Array"})) boxedT (list.n/range +1 level))]] ($_ seq @@ -335,7 +335,7 @@ [!unboxed !boxed] (|> array-type (r.filter (function (_ [!unboxed !boxed]) (not (text/= boxed !boxed))))) - #let [boxedT (#.Primitive boxed (list)) + #let [boxedT {#.Primitive boxed (list)} boxedC (`' ("lux check" (+0 (~ (code.text boxed)) (+0)) ("jvm object null"))) !boxedC (`' ("lux check" (+0 (~ (code.text !boxed)) (+0)) @@ -354,12 +354,12 @@ (test "jvm object null" (success "jvm object null" (list) - (#.Primitive boxed (list)))) + {#.Primitive boxed (list)})) (test "jvm object null (no primitives)" (or (text/= "java.lang.Object" boxed) (failure "jvm object null" (list) - (#.Primitive unboxed (list))))) + {#.Primitive unboxed (list)}))) (test "jvm object null?" (success "jvm object null?" (list boxedC) @@ -381,7 +381,7 @@ (test "jvm object class" (success "jvm object class" (list (code.text boxed)) - (#.Primitive "java.lang.Class" (list boxedT)))) + {#.Primitive "java.lang.Class" (list boxedT)})) (test "jvm object instance?" (success "jvm object instance?" (list (code.text boxed) @@ -406,12 +406,12 @@ (success "jvm member static get" (list (code.text "java.lang.System") (code.text "out")) - (#.Primitive "java.io.PrintStream" (list)))) + {#.Primitive "java.io.PrintStream" (list)})) (test "jvm member static get (inheritance out)" (success "jvm member static get" (list (code.text "java.lang.System") (code.text "out")) - (#.Primitive "java.lang.Object" (list)))) + {#.Primitive "java.lang.Object" (list)})) (test "jvm member static put" (success "jvm member static put" (list (code.text "java.awt.datatransfer.DataFlavor") @@ -444,14 +444,14 @@ (code.text "id") (`' ("lux check" (+0 "org.omg.CORBA.ValueMember" (+0)) ("jvm object null")))) - (#.Primitive "java.lang.String" (list)))) + {#.Primitive "java.lang.String" (list)})) (test "jvm member virtual get (inheritance out)" (success "jvm member virtual get" (list (code.text "org.omg.CORBA.ValueMember") (code.text "id") (`' ("lux check" (+0 "org.omg.CORBA.ValueMember" (+0)) ("jvm object null")))) - (#.Primitive "java.lang.Object" (list)))) + {#.Primitive "java.lang.Object" (list)})) (test "jvm member virtual put" (success "jvm member virtual put" (list (code.text "org.omg.CORBA.ValueMember") @@ -488,14 +488,14 @@ (success "jvm member static get" (list (code.text "java.util.GregorianCalendar") (code.text "AD")) - (#.Primitive "java.lang.Integer" (list)))) + {#.Primitive "java.lang.Integer" (list)})) (test "jvm member virtual get" (success "jvm member virtual get" (list (code.text "javax.accessibility.AccessibleAttributeSequence") (code.text "startIndex") (`' ("lux check" (+0 "javax.accessibility.AccessibleAttributeSequence" (+0)) ("jvm object null")))) - (#.Primitive "java.lang.Integer" (list)))) + {#.Primitive "java.lang.Integer" (list)})) (test "jvm member virtual put" (success "jvm member virtual put" (list (code.text "javax.accessibility.AccessibleAttributeSequence") @@ -522,28 +522,28 @@ (success' (` ("jvm member invoke static" "java.lang.Long" "decode" ["java.lang.String" (~ stringC)])) - (#.Primitive "java.lang.Long" (list)))) + {#.Primitive "java.lang.Long" (list)})) (test "jvm member invoke virtual" (success' (` ("jvm object cast" ("jvm member invoke virtual" "java.lang.Object" "equals" ("jvm object cast" (~ longC)) ["java.lang.Object" ("jvm object cast" (~ longC))]))) - (#.Primitive "java.lang.Boolean" (list)))) + {#.Primitive "java.lang.Boolean" (list)})) (test "jvm member invoke special" (success' (` ("jvm object cast" ("jvm member invoke special" "java.lang.Long" "equals" ("jvm object cast" (~ longC)) ["java.lang.Object" ("jvm object cast" (~ longC))]))) - (#.Primitive "java.lang.Boolean" (list)))) + {#.Primitive "java.lang.Boolean" (list)})) (test "jvm member invoke interface" (success' (` ("jvm object cast" ("jvm member invoke interface" "java.util.Collection" "add" ("jvm object cast" (~ objectC)) ["java.lang.Object" ("jvm object cast" (~ longC))]))) - (#.Primitive "java.lang.Boolean" (list)))) + {#.Primitive "java.lang.Boolean" (list)})) (test "jvm member invoke constructor" (success' (` ("jvm member invoke constructor" "java.util.ArrayList" ["int" ("jvm object cast" (~ intC))])) - (All (_ a) (#.Primitive "java.util.ArrayList" (list a))))) + (All (_ a) {#.Primitive "java.util.ArrayList" (list a)}))) ))) diff --git a/lux-jvm/test/test/luxc/lang/synthesis/loop.lux b/lux-jvm/test/test/luxc/lang/synthesis/loop.lux index ad2a67deb..b923a4e90 100644 --- a/lux-jvm/test/test/luxc/lang/synthesis/loop.lux +++ b/lux-jvm/test/test/luxc/lang/synthesis/loop.lux @@ -21,29 +21,29 @@ (-> ls.Arity ls.Synthesis Bit) (loop [exprS exprS] (case exprS - (^ [_ (#.Form (list [_ (#.Text "lux case")] inputS pathS))]) + (^ [_ {#.Form (list [_ {#.Text "lux case"}] inputS pathS)}]) (loop [pathS pathS] (case pathS - (^ [_ (#.Form (list [_ (#.Text "lux case alt")] leftS rightS))]) + (^ [_ {#.Form (list [_ {#.Text "lux case alt"}] leftS rightS)}]) (or (recur leftS) (recur rightS)) - (^ [_ (#.Form (list [_ (#.Text "lux case seq")] leftS rightS))]) + (^ [_ {#.Form (list [_ {#.Text "lux case seq"}] leftS rightS)}]) (recur rightS) - (^ [_ (#.Form (list [_ (#.Text "lux case exec")] bodyS))]) + (^ [_ {#.Form (list [_ {#.Text "lux case exec"}] bodyS)}]) (does-recursion? arity bodyS) _ #0)) - (^ [_ (#.Form (list& [_ (#.Text "lux recur")] argsS))]) + (^ [_ {#.Form (list& [_ {#.Text "lux recur"}] argsS)}]) (n/= arity (list.size argsS)) - (^ [_ (#.Form (list [_ (#.Text "lux let")] register inputS bodyS))]) + (^ [_ {#.Form (list [_ {#.Text "lux let"}] register inputS bodyS)}]) (recur bodyS) - (^ [_ (#.Form (list [_ (#.Text "lux if")] inputS thenS elseS))]) + (^ [_ {#.Form (list [_ {#.Text "lux if"}] inputS thenS elseS)}]) (or (recur thenS) (recur elseS)) @@ -132,7 +132,7 @@ (test "Can accurately identify (and then reify) tail recursion." (case (expressionS.synthesize extensionL.no-syntheses analysis) - (^ [_ (#.Form (list [_ (#.Text "lux function")] [_ (#.Nat _arity)] [_ (#.Tuple _env)] _body))]) + (^ [_ {#.Form (list [_ {#.Text "lux function"}] [_ {#.Nat _arity}] [_ {#.Tuple _env}] _body)}]) (|> _body (does-recursion? arity) (bit/= prediction) @@ -149,13 +149,13 @@ (test "Can reify loops." (case (expressionS.synthesize extensionL.no-syntheses (la.apply (list.repeat arity (' [])) analysis)) - (^ [_ (#.Form (list [_ (#.Text "lux loop")] [_ (#.Nat in_register)] [_ (#.Tuple _inits)] _body))]) + (^ [_ {#.Form (list [_ {#.Text "lux loop"}] [_ {#.Nat in_register}] [_ {#.Tuple _inits}] _body)}]) (and (n/= arity (list.size _inits)) (not (loopS.contains-self-reference? _body))) - (^ [_ (#.Form (list& [_ (#.Text "lux call")] - [_ (#.Form (list [_ (#.Text "lux function")] _arity _env _bodyS))] - argsS))]) + (^ [_ {#.Form (list& [_ {#.Text "lux call"}] + [_ {#.Form (list [_ {#.Text "lux function"}] _arity _env _bodyS)}] + argsS)}]) (loopS.contains-self-reference? _bodyS) _ diff --git a/lux-jvm/test/test/luxc/lang/synthesis/procedure.lux b/lux-jvm/test/test/luxc/lang/synthesis/procedure.lux index 1262f2252..0d73b1038 100644 --- a/lux-jvm/test/test/luxc/lang/synthesis/procedure.lux +++ b/lux-jvm/test/test/luxc/lang/synthesis/procedure.lux @@ -24,7 +24,7 @@ (test "Can synthesize procedure calls." (|> (expressionS.synthesize extensionL.no-syntheses (la.procedure nameA argsA)) - (case> (^ [_ (#.Form (list& [_ (#.Text procedure)] argsS))]) + (case> (^ [_ {#.Form (list& [_ {#.Text procedure}] argsS)}]) (and (text/= nameA procedure) (list.every? (product.uncurried corresponds?) (list.zip2 argsA argsS))) diff --git a/lux-jvm/test/test/luxc/lang/translation/js.lux b/lux-jvm/test/test/luxc/lang/translation/js.lux index effad7726..69bcd7ecd 100644 --- a/lux-jvm/test/test/luxc/lang/translation/js.lux +++ b/lux-jvm/test/test/luxc/lang/translation/js.lux @@ -22,7 +22,7 @@ (def: (test-primitive-identity synthesis) (-> Synthesis Bit) (|> (run-js (` ("lux is" (~ synthesis) (~ synthesis)))) - (case> (#e.Success valueV) + (case> {#e.Success valueV} (:coerce Bit valueV) _ @@ -33,10 +33,10 @@ (template [
 <=>]
   [(def: ( angle)
      (->  Check)
-     (|>> (case> (#e.Success valueV)
+     (|>> (case> {#e.Success valueV}
                  (<=> (
 angle) (:coerce  valueV))
                  
-                 (#e.Error error)
+                 {#e.Error error}
                  #0)))]
 
   [sin-check    Frac math.sin f/=]
@@ -73,7 +73,7 @@
         ($_ seq
             (test "Cannot get non-existing fields from objects."
                   (|> (run-js (` ("js object get" (~ field) (~ empty-object))))
-                      (case> (^multi (#e.Success valueV)
+                      (case> (^multi {#e.Success valueV}
                                      [(:coerce (Maybe Int) valueV) #.None])
                              #1
 
@@ -81,8 +81,8 @@
                              #0)))
             (test "Can get fields from objects."
                   (|> (run-js (` ("js object get" (~ field) (~ object))))
-                      (case> (^multi (#e.Success valueV)
-                                     [(:coerce (Maybe Int) valueV) (#.Some valueV)])
+                      (case> (^multi {#e.Success valueV}
+                                     [(:coerce (Maybe Int) valueV) {#.Some valueV}])
                              (i/= value (:coerce Int valueV))
 
                              _
@@ -90,7 +90,7 @@
             (test "Can delete fields from objects."
                   (|> (run-js (let [post-delete (` ("js object delete" (~ field) (~ object)))]
                                 (` ("js object get" (~ field) (~ post-delete)))))
-                      (case> (^multi (#e.Success valueV)
+                      (case> (^multi {#e.Success valueV}
                                      [(:coerce (Maybe Int) valueV) #.None])
                              #1
 
@@ -99,10 +99,10 @@
             (test "Can instance new objects."
                   (let [base (` ("js object new" ("js global" "Number") (~ (code.text (%f frac-value)))))]
                     (|> (run-js (` ("lux frac +" (~ base) 0.0)))
-                        (case> (#e.Success valueV)
+                        (case> {#e.Success valueV}
                                (f/= frac-value (:coerce Frac valueV))
 
-                               (#e.Error error)
+                               {#e.Error error}
                                #0))))
             (test "Can call methods on objects."
                   (|> (run-js (` ("js object call" ("js global" "Math") "sin" (~ (code.text (%f frac-value))))))
@@ -124,9 +124,9 @@
                       (length-check length)))
             (test "Can get an element from an array."
                   (|> (run-js (` ("js array read" (~ (code.nat idx)) (~ arrayS))))
-                      (case> (^multi (#e.Success elemV)
+                      (case> (^multi {#e.Success elemV}
                                      [[(list.nth idx elems) (:coerce (Maybe Nat) elemV)]
-                                      [(#.Some reference) (#.Some sample)]])
+                                      [{#.Some reference} {#.Some sample}]])
                              (n/= reference sample)
 
                              _
@@ -136,9 +136,9 @@
                         overwriteS (code.nat overwrite)]
                     (|> (run-js (` ("js array read" (~ idxS)
                                     ("js array write" (~ idxS) (~ overwriteS) (~ arrayS)))))
-                        (case> (^multi (#e.Success elemV)
+                        (case> (^multi {#e.Success elemV}
                                        [(:coerce (Maybe Nat) elemV)
-                                        (#.Some sample)])
+                                        {#.Some sample}])
                                (n/= overwrite sample)
 
                                _
@@ -149,7 +149,7 @@
                     (and (|> (run-js (` ("js array length" (~ deleteS))))
                              (length-check length))
                          (|> (run-js (` ("js array read" (~ idxS) (~ deleteS))))
-                             (case> (^multi (#e.Success elemV)
+                             (case> (^multi {#e.Success elemV}
                                             [(:coerce (Maybe Nat) elemV)
                                              #.None])
                                     #1
diff --git a/lux-jvm/test/test/luxc/lang/translation/jvm.lux b/lux-jvm/test/test/luxc/lang/translation/jvm.lux
index 95812e6ca..86c8253e4 100644
--- a/lux-jvm/test/test/luxc/lang/translation/jvm.lux
+++ b/lux-jvm/test/test/luxc/lang/translation/jvm.lux
@@ -36,10 +36,10 @@
                                                  (evalT.eval sampleI))
                                                (lang.with-current-module "")
                                                (macro.result (io.run! init-jvm))
-                                               (case> (#e.Success valueT)
+                                               (case> {#e.Success valueT}
                                                       (  (:coerce  valueT))
 
-                                                      (#e.Error error)
+                                                      {#e.Error error}
                                                       #0)))]
 
                                     ["jvm convert double-to-float" "jvm convert float-to-double" code.frac frac-sample Frac f/=]
@@ -68,10 +68,10 @@
                                    (evalT.eval sampleI))
                                  (lang.with-current-module "")
                                  (macro.result (io.run! init-jvm))
-                                 (case> (#e.Success valueT)
+                                 (case> {#e.Success valueT}
                                         (  (:coerce  valueT))
 
-                                        (#e.Error error)
+                                        {#e.Error error}
                                         #0)))]
 
                       ["jvm convert long-to-int"   "jvm convert int-to-char"  "jvm convert char-to-long"  code.int int-sample Int i/=]
@@ -95,10 +95,10 @@
                                    (evalT.eval sampleI))
                                  (lang.with-current-module "")
                                  (macro.result (io.run! init-jvm))
-                                 (case> (#e.Success valueT)
+                                 (case> {#e.Success valueT}
                                         (  (:coerce  valueT))
 
-                                        (#e.Error error)
+                                        {#e.Error error}
                                         #0)))]
 
                       ["jvm convert long-to-int" "jvm convert int-to-char" "jvm convert char-to-byte" "jvm convert byte-to-long" code.int int-sample Int i/=]
@@ -136,11 +136,11 @@
                                                     (evalT.eval sampleI))
                                                   (lang.with-current-module "")
                                                   (macro.result (io.run! init-jvm))
-                                                  (case> (#e.Success valueT)
+                                                  (case> {#e.Success valueT}
                                                          ( ( param subject)
                                                                  (:coerce  valueT))
 
-                                                         (#e.Error error)
+                                                         {#e.Error error}
                                                          #0)))]
 
                                        [(format "jvm "  " +") <+>]
@@ -175,11 +175,11 @@
                                       (evalT.eval sampleI))
                                     (lang.with-current-module "")
                                     (macro.result (io.run! init-jvm))
-                                    (case> (#e.Success valueT)
+                                    (case> {#e.Success valueT}
                                            (n/= ( param subject)
                                                 (:coerce Nat valueT))
 
-                                           (#e.Error error)
+                                           {#e.Error error}
                                            #0)))]
 
                          [(format "jvm "  " and") bit.and]
@@ -209,11 +209,11 @@
                                       (evalT.eval sampleI))
                                     (lang.with-current-module "")
                                     (macro.result (io.run! init-jvm))
-                                    (case> (#e.Success valueT)
+                                    (case> {#e.Success valueT}
                                            ( ( shift ( subject))
                                                    (:coerce  valueT))
 
-                                           (#e.Error error)
+                                           {#e.Error error}
                                            #0)))]
 
                          [(format "jvm "  " shl") bit.left-shift Nat n/= id code.nat]
@@ -241,11 +241,11 @@
                                                     (evalT.eval sampleI))
                                                   (lang.with-current-module "")
                                                   (macro.result (io.run! init-jvm))
-                                                  (case> (#e.Success valueT)
+                                                  (case> {#e.Success valueT}
                                                          (bit/= ( param subject)
                                                                 (:coerce Bit valueT))
 
-                                                         (#e.Error error)
+                                                         {#e.Error error}
                                                          #0)))]
 
                                        [(format "jvm "  " =") <=>]
@@ -297,10 +297,10 @@
                                                  (evalT.eval sampleI))
                                                (lang.with-current-module "")
                                                (macro.result (io.run! init-jvm))
-                                               (case> (#e.Success outputZ)
+                                               (case> {#e.Success outputZ}
                                                       (  (:coerce  outputZ))
 
-                                                      (#e.Error error)
+                                                      {#e.Error error}
                                                       #0)))]
 
                                     ["boolean" Bit valueZ bit/= (code.bit valueZ)
@@ -345,10 +345,10 @@
                                                  (evalT.eval sampleI))
                                                (lang.with-current-module "")
                                                (macro.result (io.run! init-jvm))
-                                               (case> (#e.Success outputT)
+                                               (case> {#e.Success outputT}
                                                       (  (:coerce  outputT))
 
-                                                      (#e.Error error)
+                                                      {#e.Error error}
                                                       #0)))]
 
                                     ["char" Int valueC i/=
@@ -373,10 +373,10 @@
                                          (evalT.eval sampleI))
                                        (lang.with-current-module "")
                                        (macro.result (io.run! init-jvm))
-                                       (case> (#e.Success outputT)
+                                       (case> {#e.Success outputT}
                                               (f/= valueD (:coerce Frac outputT))
 
-                                              (#e.Error error)
+                                              {#e.Error error}
                                               #0)))
                              (test "jvm array length"
                                    (|> (do macro.Monad
@@ -384,10 +384,10 @@
                                          (evalT.eval sampleI))
                                        (lang.with-current-module "")
                                        (macro.result (io.run! init-jvm))
-                                       (case> (#e.Success outputT)
+                                       (case> {#e.Success outputT}
                                               (n/= size (:coerce Nat outputT))
 
-                                              (#e.Error error)
+                                              {#e.Error error}
                                               #0)))
                              )))))
 
@@ -435,10 +435,10 @@
                         (evalT.eval sampleI))
                       (lang.with-current-module "")
                       (macro.result (io.run! init-jvm))
-                      (case> (#e.Success outputT)
+                      (case> {#e.Success outputT}
                              (:coerce Bit outputT)
 
-                             (#e.Error error)
+                             {#e.Error error}
                              #0)))
             (test "jvm object null?"
                   (|> (do macro.Monad
@@ -446,10 +446,10 @@
                         (evalT.eval sampleI))
                       (lang.with-current-module "")
                       (macro.result (io.run! init-jvm))
-                      (case> (#e.Success outputT)
+                      (case> {#e.Success outputT}
                              (not (:coerce Bit outputT))
 
-                             (#e.Error error)
+                             {#e.Error error}
                              #0)))
             (test "jvm object synchronized"
                   (|> (do macro.Monad
@@ -457,10 +457,10 @@
                         (evalT.eval sampleI))
                       (lang.with-current-module "")
                       (macro.result (io.run! init-jvm))
-                      (case> (#e.Success outputT)
+                      (case> {#e.Success outputT}
                              (i/= sample (:coerce Int outputT))
 
-                             (#e.Error error)
+                             {#e.Error error}
                              #0)))
             (test "jvm object throw"
                   (|> (do macro.Monad
@@ -472,15 +472,15 @@
                         (evalT.eval sampleI))
                       (lang.with-current-module "")
                       (macro.result (io.run! init-jvm))
-                      (case> (#e.Success outputT)
+                      (case> {#e.Success outputT}
                              (case (:coerce (e.Error Any) outputT)
-                               (#e.Error error)
+                               {#e.Error error}
                                (text.contains? exception-message error)
 
-                               (#e.Success outputT)
+                               {#e.Success outputT}
                                #0)
 
-                             (#e.Error error)
+                             {#e.Error error}
                              #0)))
             (test "jvm object class"
                   (|> (do macro.Monad
@@ -488,10 +488,10 @@
                         (evalT.eval sampleI))
                       (lang.with-current-module "")
                       (macro.result (io.run! init-jvm))
-                      (case> (#e.Success outputT)
+                      (case> {#e.Success outputT}
                              (|> outputT (:coerce Class) (Class::getName []) (text/= class))
 
-                             (#e.Error error)
+                             {#e.Error error}
                              #0)))
             (test "jvm object instance?"
                   (|> (do macro.Monad
@@ -499,10 +499,10 @@
                         (evalT.eval sampleI))
                       (lang.with-current-module "")
                       (macro.result (io.run! init-jvm))
-                      (case> (#e.Success outputT)
+                      (case> {#e.Success outputT}
                              (:coerce Bit outputT)
 
-                             (#e.Error error)
+                             {#e.Error error}
                              #0)))
             ))))
 
@@ -531,10 +531,10 @@
                         (evalT.eval sampleI))
                       (lang.with-current-module "")
                       (macro.result (io.run! init-jvm))
-                      (case> (#e.Success outputT)
+                      (case> {#e.Success outputT}
                              (i/= GregorianCalendar::AD (:coerce Int outputT))
 
-                             (#e.Error error)
+                             {#e.Error error}
                              #0)))
             (test "jvm member static put"
                   (|> (do macro.Monad
@@ -543,10 +543,10 @@
                         (evalT.eval sampleI))
                       (lang.with-current-module "")
                       (macro.result (io.run! init-jvm))
-                      (case> (#e.Success outputT)
+                      (case> {#e.Success outputT}
                              (same? hostL.unit (:coerce Text outputT))
 
-                             (#e.Error error)
+                             {#e.Error error}
                              #0)))
             (test "jvm member virtual get"
                   (|> (do macro.Monad
@@ -554,10 +554,10 @@
                         (evalT.eval sampleI))
                       (lang.with-current-module "")
                       (macro.result (io.run! init-jvm))
-                      (case> (#e.Success outputT)
+                      (case> {#e.Success outputT}
                              (text/= sample-string (:coerce Text outputT))
 
-                             (#e.Error error)
+                             {#e.Error error}
                              #0)))
             (test "jvm member virtual put"
                   (|> (do macro.Monad
@@ -567,10 +567,10 @@
                         (evalT.eval sampleI))
                       (lang.with-current-module "")
                       (macro.result (io.run! init-jvm))
-                      (case> (#e.Success outputT)
+                      (case> {#e.Success outputT}
                              (text/= other-sample-string (:coerce Text outputT))
 
-                             (#e.Error error)
+                             {#e.Error error}
                              #0)))
             ))))
 
@@ -596,10 +596,10 @@
                         (evalT.eval sampleI))
                       (lang.with-current-module "")
                       (macro.result (io.run! init-jvm))
-                      (case> (#e.Success outputT)
+                      (case> {#e.Success outputT}
                              (i/= sample (:coerce Int outputT))
 
-                             (#e.Error error)
+                             {#e.Error error}
                              #0)))
             (test "jvm member invoke virtual"
                   (|> (do macro.Monad
@@ -609,10 +609,10 @@
                         (evalT.eval sampleI))
                       (lang.with-current-module "")
                       (macro.result (io.run! init-jvm))
-                      (case> (#e.Success outputT)
+                      (case> {#e.Success outputT}
                              (:coerce Bit outputT)
 
-                             (#e.Error error)
+                             {#e.Error error}
                              #0)))
             (test "jvm member invoke interface"
                   (|> (do macro.Monad
@@ -622,10 +622,10 @@
                         (evalT.eval sampleI))
                       (lang.with-current-module "")
                       (macro.result (io.run! init-jvm))
-                      (case> (#e.Success outputT)
+                      (case> {#e.Success outputT}
                              (:coerce Bit outputT)
 
-                             (#e.Error error)
+                             {#e.Error error}
                              #0)))
             (test "jvm member invoke constructor"
                   (|> (do macro.Monad
@@ -633,9 +633,9 @@
                         (evalT.eval sampleI))
                       (lang.with-current-module "")
                       (macro.result (io.run! init-jvm))
-                      (case> (#e.Success outputT)
+                      (case> {#e.Success outputT}
                              (host.instance? ArrayList (:coerce Object outputT))
 
-                             (#e.Error error)
+                             {#e.Error error}
                              #0)))
             ))))
-- 
cgit v1.2.3