diff options
author | Eduardo Julian | 2021-09-03 21:51:30 -0400 |
---|---|---|
committer | Eduardo Julian | 2021-09-03 21:51:30 -0400 |
commit | 891b1cfc82322f8017f0a4f6b707d6fe52024545 (patch) | |
tree | 957429c0a2ad850b3570492deabe054fb2ace63e /stdlib/source/library/lux/target | |
parent | e76add6e6f904677f5c09bb2a66dce283f1b848a (diff) |
Unified tuple and record syntax.
Diffstat (limited to '')
17 files changed, 66 insertions, 66 deletions
diff --git a/stdlib/source/library/lux/target/common_lisp.lux b/stdlib/source/library/lux/target/common_lisp.lux index 5a5b10a06..9714e7743 100644 --- a/stdlib/source/library/lux/target/common_lisp.lux +++ b/stdlib/source/library/lux/target/common_lisp.lux @@ -61,8 +61,8 @@ (type: .public Lambda (Record - {#input Var/* - #output (Expression Any)})) + [#input Var/* + #output (Expression Any)])) (def: .public nil Literal @@ -387,9 +387,9 @@ (type: .public Handler (Record - {#condition_type (Expression Any) + [#condition_type (Expression Any) #condition Var/1 - #body (Expression Any)})) + #body (Expression Any)])) (def: .public (handler_case handlers body) (-> (List Handler) (Expression Any) (Computation Any)) diff --git a/stdlib/source/library/lux/target/jvm/attribute.lux b/stdlib/source/library/lux/target/jvm/attribute.lux index 4d79cfb86..45758f54f 100644 --- a/stdlib/source/library/lux/target/jvm/attribute.lux +++ b/stdlib/source/library/lux/target/jvm/attribute.lux @@ -27,9 +27,9 @@ (type: .public (Info about) (Record - {#name (Index UTF8) + [#name (Index UTF8) #length U4 - #info about})) + #info about])) (def: .public (info_equivalence Equivalence<about>) (All (_ about) @@ -89,9 +89,9 @@ ... TODO: Inline ASAP (def: (constant' @name index) (-> (Index UTF8) (Constant Any) Attribute) - (#Constant {#name @name + (#Constant [#name @name #length (|> /constant.length //unsigned.u4 try.trusted) - #info index})) + #info index])) (def: .public (constant index) (-> (Constant Any) (Resource Attribute)) @@ -102,13 +102,13 @@ ... TODO: Inline ASAP (def: (code' @name specification) (-> (Index UTF8) Code Attribute) - (#Code {#name @name + (#Code [#name @name ... https://docs.oracle.com/javase/specs/jvms/se8/html/jvms-4.html#jvms-4.7.3 #length (|> specification (/code.length ..length) //unsigned.u4 try.trusted) - #info specification})) + #info specification])) (def: .public (code specification) (-> Code (Resource Attribute)) diff --git a/stdlib/source/library/lux/target/jvm/attribute/code.lux b/stdlib/source/library/lux/target/jvm/attribute/code.lux index a36208054..207ddf022 100644 --- a/stdlib/source/library/lux/target/jvm/attribute/code.lux +++ b/stdlib/source/library/lux/target/jvm/attribute/code.lux @@ -24,10 +24,10 @@ (type: .public (Code Attribute) (Record - {#limit Limit + [#limit Limit #code Binary #exception_table (Row Exception) - #attributes (Row Attribute)})) + #attributes (Row Attribute)])) (def: .public (length length code) (All (_ Attribute) (-> (-> Attribute Nat) (Code Attribute) Nat)) diff --git a/stdlib/source/library/lux/target/jvm/attribute/code/exception.lux b/stdlib/source/library/lux/target/jvm/attribute/code/exception.lux index a2a4f45c1..6bdf8dfff 100644 --- a/stdlib/source/library/lux/target/jvm/attribute/code/exception.lux +++ b/stdlib/source/library/lux/target/jvm/attribute/code/exception.lux @@ -21,10 +21,10 @@ (type: .public Exception (Record - {#start Address + [#start Address #end Address #handler Address - #catch (Index Class)})) + #catch (Index Class)])) (def: .public equivalence (Equivalence Exception) diff --git a/stdlib/source/library/lux/target/jvm/bytecode.lux b/stdlib/source/library/lux/target/jvm/bytecode.lux index e3c1fc9db..0cb111e13 100644 --- a/stdlib/source/library/lux/target/jvm/bytecode.lux +++ b/stdlib/source/library/lux/target/jvm/bytecode.lux @@ -59,15 +59,15 @@ (type: .public Tracker (Record - {#program_counter Address + [#program_counter Address #next Label - #known Resolver})) + #known Resolver])) (def: fresh Tracker - {#program_counter /address.start + [#program_counter /address.start #next 0 - #known (dictionary.empty n.hash)}) + #known (dictionary.empty n.hash)]) (type: .public Relative (-> Resolver (Try [(Row Exception) Instruction]))) @@ -976,8 +976,8 @@ (do ..monad [index (<| ..lifted (<method> (..reflection class)) - {#//constant/pool.name method - #//constant/pool.descriptor (type.descriptor type)}) + [#//constant/pool.name method + #//constant/pool.descriptor (type.descriptor type)]) .let [consumption (|> inputs (list\each ..type_size) (list\mix n.+ (if <static?> 0 1)) @@ -1001,8 +1001,8 @@ (do ..monad [index (<| ..lifted (//constant/pool.field (..reflection class)) - {#//constant/pool.name field - #//constant/pool.descriptor (type.descriptor type)})] + [#//constant/pool.name field + #//constant/pool.descriptor (type.descriptor type)])] (if (or (same? type.long type) (same? type.double type)) (..bytecode <consumption> $2 @_ <2> [index]) @@ -1036,10 +1036,10 @@ (in []) (exception.except ..invalid_range_for_try [@start @end])) [_ @handler] (..resolve_label @handler resolver)] - (in [(row.row {#//exception.start @start + (in [(row.row [#//exception.start @start #//exception.end @end #//exception.handler @handler - #//exception.catch @catch}) + #//exception.catch @catch]) _.empty]))) []]])))) diff --git a/stdlib/source/library/lux/target/jvm/bytecode/environment.lux b/stdlib/source/library/lux/target/jvm/bytecode/environment.lux index ff778621c..2bf2c5c31 100644 --- a/stdlib/source/library/lux/target/jvm/bytecode/environment.lux +++ b/stdlib/source/library/lux/target/jvm/bytecode/environment.lux @@ -19,16 +19,16 @@ (type: .public Environment (Record - {#limit Limit - #stack (Maybe Stack)})) + [#limit Limit + #stack (Maybe Stack)])) (template [<name> <limit>] [(def: .public (<name> type) (-> (Type Method) (Try Environment)) (do try.monad [limit (<limit> type)] - (in {#limit limit - #stack (#.Some /stack.empty)})))] + (in [#limit limit + #stack (#.Some /stack.empty)])))] [static /limit.static] [virtual /limit.virtual] diff --git a/stdlib/source/library/lux/target/jvm/bytecode/environment/limit.lux b/stdlib/source/library/lux/target/jvm/bytecode/environment/limit.lux index 515728d71..4ab466ae4 100644 --- a/stdlib/source/library/lux/target/jvm/bytecode/environment/limit.lux +++ b/stdlib/source/library/lux/target/jvm/bytecode/environment/limit.lux @@ -22,16 +22,16 @@ (type: .public Limit (Record - {#stack Stack - #registry Registry})) + [#stack Stack + #registry Registry])) (template [<name> <registry>] [(def: .public (<name> type) (-> (Type Method) (Try Limit)) (do try.monad [registry (<registry> type)] - (in {#stack /stack.empty - #registry registry})))] + (in [#stack /stack.empty + #registry registry])))] [static /registry.static] [virtual /registry.virtual] diff --git a/stdlib/source/library/lux/target/jvm/class.lux b/stdlib/source/library/lux/target/jvm/class.lux index 03853a4ee..1dae89e90 100644 --- a/stdlib/source/library/lux/target/jvm/class.lux +++ b/stdlib/source/library/lux/target/jvm/class.lux @@ -30,7 +30,7 @@ (type: .public Class (Rec Class (Record - {#magic Magic + [#magic Magic #minor_version Minor #major_version Major #constant_pool Pool @@ -40,7 +40,7 @@ #interfaces (Row (Index //constant.Class)) #fields (Row Field) #methods (Row Method) - #attributes (Row Attribute)}))) + #attributes (Row Attribute)]))) (modifiers: Class ["0001" public] @@ -100,7 +100,7 @@ =fields (monad.all //constant/pool.monad fields) =methods (monad.all //constant/pool.monad methods)] (in [classes =fields =methods])))] - (in {#magic //magic.code + (in [#magic //magic.code #minor_version //version.default_minor #major_version version #constant_pool pool @@ -110,7 +110,7 @@ #interfaces @interfaces #fields (row.of_list =fields) #methods (row.of_list =methods) - #attributes attributes}))) + #attributes attributes]))) (def: .public (writer class) (Writer Class) diff --git a/stdlib/source/library/lux/target/jvm/constant.lux b/stdlib/source/library/lux/target/jvm/constant.lux index 63eff794c..780816d70 100644 --- a/stdlib/source/library/lux/target/jvm/constant.lux +++ b/stdlib/source/library/lux/target/jvm/constant.lux @@ -134,13 +134,13 @@ (type: .public (Name_And_Type of) (Record - {#name (Index UTF8) - #descriptor (Index (Descriptor of))})) + [#name (Index UTF8) + #descriptor (Index (Descriptor of))])) (type: .public (Reference of) (Record - {#class (Index Class) - #name_and_type (Index (Name_And_Type of))})) + [#class (Index Class) + #name_and_type (Index (Name_And_Type of))])) (template [<type> <equivalence> <writer>] [(def: .public <equivalence> diff --git a/stdlib/source/library/lux/target/jvm/constant/pool.lux b/stdlib/source/library/lux/target/jvm/constant/pool.lux index d71b3727e..a680980ef 100644 --- a/stdlib/source/library/lux/target/jvm/constant/pool.lux +++ b/stdlib/source/library/lux/target/jvm/constant/pool.lux @@ -122,8 +122,8 @@ (type: .public (Member of) (Record - {#name UTF8 - #descriptor (Descriptor of)})) + [#name UTF8 + #descriptor (Descriptor of)])) (def: .public (name_and_type [name descriptor]) (All (_ of) @@ -131,7 +131,7 @@ (do ..monad [@name (utf8 name) @descriptor (..descriptor descriptor)] - (!add #//.Name_And_Type //.name_and_type_equivalence {#//.name @name #//.descriptor @descriptor}))) + (!add #//.Name_And_Type //.name_and_type_equivalence [#//.name @name #//.descriptor @descriptor]))) (template [<name> <tag> <of>] [(def: .public (<name> class member) @@ -139,7 +139,7 @@ (do ..monad [@class (..class (//name.internal class)) @name_and_type (name_and_type member)] - (!add <tag> //.reference_equivalence {#//.class @class #//.name_and_type @name_and_type})))] + (!add <tag> //.reference_equivalence [#//.class @class #//.name_and_type @name_and_type])))] [field #//.Field Value] [method #//.Method Method] diff --git a/stdlib/source/library/lux/target/jvm/field.lux b/stdlib/source/library/lux/target/jvm/field.lux index 5514a2674..a709da105 100644 --- a/stdlib/source/library/lux/target/jvm/field.lux +++ b/stdlib/source/library/lux/target/jvm/field.lux @@ -23,10 +23,10 @@ (type: .public Field (Rec Field (Record - {#modifier (Modifier Field) + [#modifier (Modifier Field) #name (Index UTF8) #descriptor (Index (Descriptor Value)) - #attributes (Row Attribute)}))) + #attributes (Row Attribute)]))) (modifiers: Field ["0001" public] @@ -66,7 +66,7 @@ (do //constant/pool.monad [@name (//constant/pool.utf8 name) @descriptor (//constant/pool.descriptor (//type.descriptor type))] - (in {#modifier modifier + (in [#modifier modifier #name @name #descriptor @descriptor - #attributes attributes}))) + #attributes attributes]))) diff --git a/stdlib/source/library/lux/target/jvm/method.lux b/stdlib/source/library/lux/target/jvm/method.lux index 09a7d56f1..638d4091f 100644 --- a/stdlib/source/library/lux/target/jvm/method.lux +++ b/stdlib/source/library/lux/target/jvm/method.lux @@ -29,10 +29,10 @@ (type: .public Method (Rec Method (Record - {#modifier (Modifier Method) + [#modifier (Modifier Method) #name (Index UTF8) #descriptor (Index (Descriptor //type/category.Method)) - #attributes (Row Attribute)}))) + #attributes (Row Attribute)]))) (modifiers: Method ["0001" public] @@ -71,18 +71,18 @@ (function (_ _) (#try.Failure error))) [environment exceptions instruction output] (//bytecode.resolve environment code) .let [bytecode (|> instruction //bytecode/instruction.result format.instance)] - @code (//attribute.code {#//attribute/code.limit (value@ #//bytecode/environment.limit environment) + @code (//attribute.code [#//attribute/code.limit (value@ #//bytecode/environment.limit environment) #//attribute/code.code bytecode #//attribute/code.exception_table exceptions - #//attribute/code.attributes (row.row)})] + #//attribute/code.attributes (row.row)])] (in (row.suffix @code attributes))) #.None (in attributes))] - (in {#modifier modifier + (in [#modifier modifier #name @name #descriptor @descriptor - #attributes attributes}))) + #attributes attributes]))) (def: .public equivalence (Equivalence Method) diff --git a/stdlib/source/library/lux/target/jvm/type.lux b/stdlib/source/library/lux/target/jvm/type.lux index 0b89649c3..55c6bd921 100644 --- a/stdlib/source/library/lux/target/jvm/type.lux +++ b/stdlib/source/library/lux/target/jvm/type.lux @@ -38,9 +38,9 @@ (type: .public Constraint (Record - {#name Text + [#name Text #super_class (Type Class) - #super_interfaces (List (Type Class))})) + #super_interfaces (List (Type Class))])) (template [<name> <style>] [(def: .public (<name> type) diff --git a/stdlib/source/library/lux/target/php.lux b/stdlib/source/library/lux/target/php.lux index a14b3e0ce..57fca8e65 100644 --- a/stdlib/source/library/lux/target/php.lux +++ b/stdlib/source/library/lux/target/php.lux @@ -94,8 +94,8 @@ (type: .public Argument (Record - {#reference? Bit - #var Var})) + [#reference? Bit + #var Var])) (def: .public ; (-> Expression Statement) @@ -477,9 +477,9 @@ (type: .public Except (Record - {#class Constant + [#class Constant #exception Var - #handler Statement})) + #handler Statement])) (def: (catch except) (-> Except Text) diff --git a/stdlib/source/library/lux/target/python.lux b/stdlib/source/library/lux/target/python.lux index 6b24b6ae2..f0d4e23f2 100644 --- a/stdlib/source/library/lux/target/python.lux +++ b/stdlib/source/library/lux/target/python.lux @@ -396,9 +396,9 @@ (type: .public Except (Record - {#classes (List SVar) + [#classes (List SVar) #exception SVar - #handler (Statement Any)})) + #handler (Statement Any)])) (def: .public (try body! excepts) (-> (Statement Any) (List Except) (Statement Any)) diff --git a/stdlib/source/library/lux/target/ruby.lux b/stdlib/source/library/lux/target/ruby.lux index fb1eaed26..501c4d1e7 100644 --- a/stdlib/source/library/lux/target/ruby.lux +++ b/stdlib/source/library/lux/target/ruby.lux @@ -308,9 +308,9 @@ (type: .public Rescue (Record - {#classes (List Text) + [#classes (List Text) #exception LVar - #rescue Statement})) + #rescue Statement])) (def: .public (begin body! rescues) (-> Statement (List Rescue) Statement) diff --git a/stdlib/source/library/lux/target/scheme.lux b/stdlib/source/library/lux/target/scheme.lux index 97aabfb76..5bce310fc 100644 --- a/stdlib/source/library/lux/target/scheme.lux +++ b/stdlib/source/library/lux/target/scheme.lux @@ -60,8 +60,8 @@ (type: .public Arguments (Record - {#mandatory (List Var) - #rest (Maybe Var)})) + [#mandatory (List Var) + #rest (Maybe Var)])) (def: .public manual (-> Text Code) |