From 891b1cfc82322f8017f0a4f6b707d6fe52024545 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Fri, 3 Sep 2021 21:51:30 -0400 Subject: Unified tuple and record syntax. --- .../specification/compositor/generation/case.lux | 4 ++-- .../specification/compositor/generation/common.lux | 8 +++---- .../compositor/generation/function.lux | 28 +++++++++++----------- .../compositor/generation/structure.lux | 4 ++-- 4 files changed, 22 insertions(+), 22 deletions(-) (limited to 'stdlib/source/specification') diff --git a/stdlib/source/specification/compositor/generation/case.lux b/stdlib/source/specification/compositor/generation/case.lux index 3bfcec4e8..d1d0074fd 100644 --- a/stdlib/source/specification/compositor/generation/case.lux +++ b/stdlib/source/specification/compositor/generation/case.lux @@ -85,9 +85,9 @@ [subS subP] case .let [right? (tail? size idx) caseS (synthesis.variant - {#analysis.lefts idx + [#analysis.lefts idx #analysis.right? right? - #analysis.value subS}) + #analysis.value subS]) caseP ($_ synthesis.path/seq (if right? (synthesis.side/right idx) diff --git a/stdlib/source/specification/compositor/generation/common.lux b/stdlib/source/specification/compositor/generation/common.lux index 729ce81f4..e9d8eae55 100644 --- a/stdlib/source/specification/compositor/generation/common.lux +++ b/stdlib/source/specification/compositor/generation/common.lux @@ -297,10 +297,10 @@ (_.test "Can throw runtime errors." (and (|> (#synthesis.Extension "lux try" (list (synthesis.function/abstraction - {#synthesis.environment (list) + [#synthesis.environment (list) #synthesis.arity 1 #synthesis.body (#synthesis.Extension "lux io error" - (list (synthesis.text message)))}))) + (list (synthesis.text message)))]))) (run (..safe "lux try")) (case> (^multi (#try.Success valueV) {(:as (Try Text) valueV) (#try.Failure error)}) @@ -310,9 +310,9 @@ false)) (|> (#synthesis.Extension "lux try" (list (synthesis.function/abstraction - {#synthesis.environment (list) + [#synthesis.environment (list) #synthesis.arity 1 - #synthesis.body (synthesis.text message)}))) + #synthesis.body (synthesis.text message)]))) (run (..safe "lux try")) (case> (^multi (#try.Success valueV) {(:as (Try Text) valueV) (#try.Success valueV)}) diff --git a/stdlib/source/specification/compositor/generation/function.lux b/stdlib/source/specification/compositor/generation/function.lux index 36b45c283..d97b2c02c 100644 --- a/stdlib/source/specification/compositor/generation/function.lux +++ b/stdlib/source/specification/compositor/generation/function.lux @@ -43,9 +43,9 @@ local (..local arity)] (in [arity local (synthesis.function/abstraction - {#synthesis.environment (list) + [#synthesis.environment (list) #synthesis.arity arity - #synthesis.body (synthesis.variable/local local)})]))) + #synthesis.body (synthesis.variable/local local)])]))) (def: .public (spec run) (-> Runner Test) @@ -57,18 +57,18 @@ inputsS (list\each (|>> synthesis.f64) inputs)]] ($_ _.and (_.test "Can read arguments." - (|> (synthesis.function/apply {#synthesis.function functionS - #synthesis.arguments inputsS}) + (|> (synthesis.function/apply [#synthesis.function functionS + #synthesis.arguments inputsS]) (run "with_local") (//case.verify expectation))) (_.test "Can partially apply functions." (or (n.= 1 arity) (let [preS (list.first partial_arity inputsS) postS (list.after partial_arity inputsS) - partialS (synthesis.function/apply {#synthesis.function functionS - #synthesis.arguments preS})] - (|> (synthesis.function/apply {#synthesis.function partialS - #synthesis.arguments postS}) + partialS (synthesis.function/apply [#synthesis.function functionS + #synthesis.arguments preS])] + (|> (synthesis.function/apply [#synthesis.function partialS + #synthesis.arguments postS]) (run "partial_application") (//case.verify expectation))))) (_.test "Can read environment." @@ -81,15 +81,15 @@ (synthesis.variable/local (|> local (n.- partial_arity)))) inner_arity (n.- partial_arity arity) innerS (synthesis.function/abstraction - {#synthesis.environment environment + [#synthesis.environment environment #synthesis.arity inner_arity - #synthesis.body variableS}) + #synthesis.body variableS]) outerS (synthesis.function/abstraction - {#synthesis.environment (list) + [#synthesis.environment (list) #synthesis.arity partial_arity - #synthesis.body innerS})] - (|> (synthesis.function/apply {#synthesis.function outerS - #synthesis.arguments inputsS}) + #synthesis.body innerS])] + (|> (synthesis.function/apply [#synthesis.function outerS + #synthesis.arguments inputsS]) (run "with_foreign") (//case.verify expectation))))) ))) diff --git a/stdlib/source/specification/compositor/generation/structure.lux b/stdlib/source/specification/compositor/generation/structure.lux index ec9893e7c..33e38520f 100644 --- a/stdlib/source/specification/compositor/generation/structure.lux +++ b/stdlib/source/specification/compositor/generation/structure.lux @@ -36,11 +36,11 @@ .let [last?_in (|> num_tags -- (n.= tag_in))] value_in r.i64] (_.test (%.name (name_of synthesis.variant)) - (|> (synthesis.variant {#analysis.lefts (if last?_in + (|> (synthesis.variant [#analysis.lefts (if last?_in (-- tag_in) tag_in) #analysis.right? last?_in - #analysis.value (synthesis.i64 value_in)}) + #analysis.value (synthesis.i64 value_in)]) (run "variant") (case> (#try.Success valueT) (let [valueT (:as (Array Any) valueT)] -- cgit v1.2.3