From 77301f3a456c015daa9d8f9aa3d80fd4e45f8e7e Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Wed, 8 Sep 2021 21:44:06 -0400 Subject: De-bracing part 0 --- .../library/lux/control/concurrency/actor.lux | 2 +- .../library/lux/control/concurrency/thread.lux | 2 +- stdlib/source/library/lux/ffi.jvm.lux | 10 ++-- stdlib/source/library/lux/ffi.old.lux | 10 ++-- stdlib/source/library/lux/target/jvm/loader.lux | 2 +- .../source/test/lux/control/concurrency/actor.lux | 6 +-- stdlib/source/test/lux/ffi.jvm.lux | 59 ++++++++++++---------- stdlib/source/test/lux/ffi.old.lux | 12 ++--- 8 files changed, 55 insertions(+), 48 deletions(-) (limited to 'stdlib') diff --git a/stdlib/source/library/lux/control/concurrency/actor.lux b/stdlib/source/library/lux/control/concurrency/actor.lux index 617068a4c..5ce45f632 100644 --- a/stdlib/source/library/lux/control/concurrency/actor.lux +++ b/stdlib/source/library/lux/control/concurrency/actor.lux @@ -276,7 +276,7 @@ (~+ messages)]))))))) -(syntax: .public (actor [[state_type init] (.record (<>.and .any .any)) +(syntax: .public (actor [[state_type init] (.tuple (<>.and .any .any)) ?on_mail on_mail^]) (with_identifiers [g!_] (in (list (` (: ((~! io.IO) (..Actor (~ state_type))) diff --git a/stdlib/source/library/lux/control/concurrency/thread.lux b/stdlib/source/library/lux/control/concurrency/thread.lux index b0571cc64..4e82d76a6 100644 --- a/stdlib/source/library/lux/control/concurrency/thread.lux +++ b/stdlib/source/library/lux/control/concurrency/thread.lux @@ -105,7 +105,7 @@ (-> Nat (IO Any) (IO Any)) (with_expansions [ (as_is (let [runnable (ffi.object [] [java/lang/Runnable] [] - (java/lang/Runnable [] (run self) void + (java/lang/Runnable [] (run self []) void (..execute! action)))] (case milli_seconds 0 (java/util/concurrent/Executor::execute runnable runner) diff --git a/stdlib/source/library/lux/ffi.jvm.lux b/stdlib/source/library/lux/ffi.jvm.lux index b71944646..8b7ba8911 100644 --- a/stdlib/source/library/lux/ffi.jvm.lux +++ b/stdlib/source/library/lux/ffi.jvm.lux @@ -706,7 +706,7 @@ (def: annotation_parameters^ (Parser (List Annotation_Parameter)) - (.record (<>.some (<>.and .local_tag .any)))) + (.tuple (<>.some (<>.and .local_tag .any)))) (def: annotation^ (Parser Annotation) @@ -771,16 +771,16 @@ (def: (argument^ type_vars) (-> (List (Type Var)) (Parser Argument)) - (.record (<>.and .local_identifier - (..type^ type_vars)))) + (<>.and .local_identifier + (..type^ type_vars))) (def: (arguments^ type_vars) (-> (List (Type Var)) (Parser (List Argument))) - (<>.some (..argument^ type_vars))) + (.tuple (<>.some (..argument^ type_vars)))) (def: (constructor_arg^ type_vars) (-> (List (Type Var)) (Parser (Typed Code))) - (.record (<>.and (..type^ type_vars) .any))) + (<>.and (..type^ type_vars) .any)) (def: (constructor_args^ type_vars) (-> (List (Type Var)) (Parser (List (Typed Code)))) diff --git a/stdlib/source/library/lux/ffi.old.lux b/stdlib/source/library/lux/ffi.old.lux index c24e49deb..f62581e68 100644 --- a/stdlib/source/library/lux/ffi.old.lux +++ b/stdlib/source/library/lux/ffi.old.lux @@ -643,7 +643,7 @@ (def: annotation_params^ (Parser (List AnnotationParam)) - (.record (<>.some (<>.and .local_tag .any)))) + (.tuple (<>.some (<>.and .local_tag .any)))) (def: annotation^ (Parser Annotation) @@ -717,16 +717,16 @@ (def: (arg_decl^ type_vars) (-> (List Type_Parameter) (Parser ArgDecl)) - (.record (<>.and .local_identifier - (..generic_type^ type_vars)))) + (<>.and .local_identifier + (..generic_type^ type_vars))) (def: (arg_decls^ type_vars) (-> (List Type_Parameter) (Parser (List ArgDecl))) - (<>.some (arg_decl^ type_vars))) + (.tuple (<>.some (arg_decl^ type_vars)))) (def: (constructor_arg^ type_vars) (-> (List Type_Parameter) (Parser ConstructorArg)) - (.record (<>.and (..generic_type^ type_vars) .any))) + (<>.and (..generic_type^ type_vars) .any)) (def: (constructor_args^ type_vars) (-> (List Type_Parameter) (Parser (List ConstructorArg))) diff --git a/stdlib/source/library/lux/target/jvm/loader.lux b/stdlib/source/library/lux/target/jvm/loader.lux index 596e57dab..fe2bba2e6 100644 --- a/stdlib/source/library/lux/target/jvm/loader.lux +++ b/stdlib/source/library/lux/target/jvm/loader.lux @@ -110,7 +110,7 @@ (<| (object [] java/lang/ClassLoader [] [] - (java/lang/ClassLoader (findClass self {class_name java/lang/String}) + (java/lang/ClassLoader (findClass self [class_name java/lang/String]) (java/lang/Class [? < java/lang/Object]) "throws" [java/lang/ClassNotFoundException] (let [class_name (:as Text class_name) diff --git a/stdlib/source/test/lux/control/concurrency/actor.lux b/stdlib/source/test/lux/control/concurrency/actor.lux index 012a9f796..27b13bba4 100644 --- a/stdlib/source/test/lux/control/concurrency/actor.lux +++ b/stdlib/source/test/lux/control/concurrency/actor.lux @@ -175,8 +175,8 @@ (in (do async.monad [verdict (async.future (do io.monad - [anonymous (/.actor {Nat - initial_state} + [anonymous (/.actor [Nat + initial_state] ((on_mail message state self) (message (++ state) self))) sent/++? (/.mail! ++! anonymous) @@ -207,7 +207,7 @@ (in (do async.monad [agent (async.future (do [! io.monad] - [agent (/.actor {Nat 0}) + [agent (/.actor [Nat 0]) _ (/.observe! (function (_ event stop) (function (_ events_seen self) (async.future diff --git a/stdlib/source/test/lux/ffi.jvm.lux b/stdlib/source/test/lux/ffi.jvm.lux index 606bd8a23..431e72641 100644 --- a/stdlib/source/test/lux/ffi.jvm.lux +++ b/stdlib/source/test/lux/ffi.jvm.lux @@ -267,7 +267,7 @@ .let [object/0 (/.object [] [test/TestInterface0] [] (test/TestInterface0 - [] (actual0 self) + [] (actual0 self []) java/lang/Long (:as java/lang/Long expected))) @@ -278,7 +278,7 @@ object/1 (/.object [] [test/TestInterface1] [] (test/TestInterface1 - [] (actual1 self {throw? java/lang/Boolean}) + [] (actual1 self [throw? java/lang/Boolean]) java/lang/Long "throws" [java/lang/Throwable] (if (:as Bit throw?) @@ -303,7 +303,7 @@ object/2 (/.object [] [test/TestInterface2] [] (test/TestInterface2 - [a] (actual2 self {input a}) + [a] (actual2 self [input a]) a input)) example/2! @@ -313,7 +313,7 @@ object/3 (/.object [] [(test/TestInterface3 java/lang/Long)] [] ((test/TestInterface3 a) - [] (actual3 self) + [] (actual3 self []) a (:as java/lang/Long expected))) @@ -326,7 +326,9 @@ object/4 (/.object [] [test/TestInterface4] [] (test/TestInterface4 - [] (actual4 self {actual_left long} {actual_right long} {_ long}) + [] (actual4 self [actual_left long + actual_right long + _ long]) long (:as java/lang/Long (i.+ (:as Int actual_left) @@ -344,10 +346,11 @@ ... Fields ("private" value java/lang/Long) ... Constructors - ("public" [] (new self {value java/lang/Long}) [] + ("public" [] (new self [value java/lang/Long]) [] (:= ::value value)) ... Methods - (test/TestInterface0 [] (actual0 self) java/lang/Long + (test/TestInterface0 [] (actual0 self []) + java/lang/Long ::value)) (/.import: test/TestClass0 @@ -358,10 +361,12 @@ ... Fields ("private" value java/lang/Long) ... Constructors - ("public" [] (new self {value java/lang/Long}) [] + ("public" [] (new self [value java/lang/Long]) [] (:= ::value value)) ... Methods - (test/TestInterface1 [] (actual1 self {throw? java/lang/Boolean}) java/lang/Long "throws" [java/lang/Throwable] + (test/TestInterface1 [] (actual1 self [throw? java/lang/Boolean]) + java/lang/Long + "throws" [java/lang/Throwable] (if (:as Bit throw?) (panic! "YOLO") ::value))) @@ -372,11 +377,11 @@ (/.class: "final" test/TestClass2 [test/TestInterface2] ... Constructors - ("public" [] (new self) [] + ("public" [] (new self []) [] []) ... Methods (test/TestInterface2 - [a] (actual2 self {input a}) + [a] (actual2 self [input a]) a input)) @@ -388,11 +393,11 @@ ... Fields ("private" value a) ... Constructors - ("public" [] (new self {value a}) [] + ("public" [] (new self [value a]) [] (:= ::value value)) ... Methods ((test/TestInterface3 a) - [] (actual3 self) + [] (actual3 self []) a ::value)) @@ -402,10 +407,10 @@ (/.class: "final" test/TestClass4 [] ... Constructors - ("public" [] (new self) [] + ("public" [] (new self []) [] []) ... Methods - ("public" (actual4 self {value java/lang/Long}) java/lang/Long + ("public" (actual4 self [value java/lang/Long]) java/lang/Long value)) (/.import: test/TestClass4 @@ -415,10 +420,10 @@ (/.class: "final" test/TestClass5 [] ... Constructors - ("public" [] (new self) [] + ("public" [] (new self []) [] []) ... Methods - ("public" "static" (actual5 {value java/lang/Long}) + ("public" "static" (actual5 [value java/lang/Long]) java/lang/Long value)) @@ -428,10 +433,10 @@ (/.class: "abstract" test/TestClass6 [] ... Constructors - ("public" [] (new self) [] + ("public" [] (new self []) [] []) ... Methods - ("public" "abstract" (actual6 {value java/lang/Long}) + ("public" "abstract" (actual6 [value java/lang/Long]) java/lang/Long)) (/.import: test/TestClass6 @@ -440,11 +445,11 @@ (/.class: "final" test/TestClass7 test/TestClass6 [] ... Constructors - ("public" [] (new self) [] + ("public" [] (new self []) [] []) ... Methods (test/TestClass6 - [] (actual6 self {input java/lang/Long}) + [] (actual6 self [input java/lang/Long]) java/lang/Long input)) @@ -454,11 +459,13 @@ (/.class: "final" test/TestClass8 [test/TestInterface4] ... Constructors - ("public" [] (new self) [] + ("public" [] (new self []) [] []) ... Methods (test/TestInterface4 - [] (actual4 self {actual_left long} {actual_right long} {_ long}) + [] (actual4 self [actual_left long + actual_right long + _ long]) long (:as java/lang/Long (i.+ (:as Int actual_left) @@ -472,12 +479,12 @@ ... Fields ("private" value9 a) ... Constructors - ("public" [] (new self {value a}) [] + ("public" [] (new self [value a]) [] (:= ::value9 value)) ... Methods - ("public" (set_actual9 self {value a}) void + ("public" (set_actual9 self [value a]) void (:= ::value9 value)) - ("public" (get_actual9 self) a + ("public" (get_actual9 self []) a ::value9)) (/.import: (test/TestClass9 a) diff --git a/stdlib/source/test/lux/ffi.old.lux b/stdlib/source/test/lux/ffi.old.lux index 56f97a962..27d18d002 100644 --- a/stdlib/source/test/lux/ffi.old.lux +++ b/stdlib/source/test/lux/ffi.old.lux @@ -43,11 +43,11 @@ (:= ::increase increase) (:= ::counter counter) [])) - ("public" (currentC self) java/lang/Long + ("public" (currentC self []) java/lang/Long ::counter) - ("public" (upC self) void + ("public" (upC self []) void (:= ::counter (i.+ ::increase ::counter))) - ("public" (downC self) void + ("public" (downC self []) void (:= ::counter (i.- ::increase ::counter)))) (/.import: (test/lux/ffi/TestClass a) @@ -73,15 +73,15 @@ (/.object [] [test/lux/ffi/TestInterface] [] (test/lux/ffi/TestInterface - [] (current self) + [] (current self []) java/lang/Long counter) (test/lux/ffi/TestInterface - [] (up self) + [] (up self []) test/lux/ffi/TestInterface (test_object increase (i.+ increase counter))) (test/lux/ffi/TestInterface - [] (down self) + [] (down self []) test/lux/ffi/TestInterface (test_object increase (i.- increase counter))))) -- cgit v1.2.3