From e64b6d0114c26a455e19a416b5f02a4d19dd711f Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Mon, 26 Jul 2021 01:45:57 -0400 Subject: Re-named Promise to Async. --- .../specification/compositor/generation/common.lux | 44 +++++++++++----------- .../compositor/generation/structure.lux | 2 +- 2 files changed, 23 insertions(+), 23 deletions(-) (limited to 'stdlib/source/specification/compositor') diff --git a/stdlib/source/specification/compositor/generation/common.lux b/stdlib/source/specification/compositor/generation/common.lux index e14aa8e52..bea185b99 100644 --- a/stdlib/source/specification/compositor/generation/common.lux +++ b/stdlib/source/specification/compositor/generation/common.lux @@ -28,7 +28,7 @@ [// [common (#+ Runner)]]]) -(def: sanitize +(def: safe (-> Text Text) (text.replace-all " " "_")) @@ -41,7 +41,7 @@ [(_.test (|> (#synthesis.Extension (list (synthesis.i64 param) (synthesis.i64 subject))) - (run (..sanitize )) + (run (..safe )) (case> (#try.Success valueT) (n.= ( param subject) (:as Nat valueT)) @@ -61,7 +61,7 @@ (|> (#synthesis.Extension "lux i64 arithmetic-right-shift" (list (synthesis.i64 subject) (synthesis.i64 param))) - (run (..sanitize "lux i64 arithmetic-right-shift")) + (run (..safe "lux i64 arithmetic-right-shift")) (case> (#try.Success valueT) ("lux i64 =" (i64.arithmetic-right-shift param subject) @@ -81,7 +81,7 @@ (~~ (template [ ] [(_.test (|> (#synthesis.Extension (list (synthesis.i64 subject))) - (run (..sanitize )) + (run (..safe )) (case> (#try.Success valueT) ( ( subject) (:as valueT)) @@ -99,7 +99,7 @@ [(_.test (|> (#synthesis.Extension (list (synthesis.i64 param) (synthesis.i64 subject))) - (run (..sanitize )) + (run (..safe )) (case> (#try.Success valueT) ( ( param subject) (:as valueT)) @@ -130,7 +130,7 @@ [(_.test (|> (#synthesis.Extension (list (synthesis.f64 param) (synthesis.f64 subject))) - (run (..sanitize )) + (run (..safe )) (//case.verify ( param subject))))] ["lux f64 +" f.+ f.=] @@ -143,7 +143,7 @@ [(_.test (|> (#synthesis.Extension (list (synthesis.f64 param) (synthesis.f64 subject))) - (run (..sanitize )) + (run (..safe )) (case> (#try.Success valueV) (bit\= ( param subject) (:as Bit valueV)) @@ -157,7 +157,7 @@ (~~ (template [ ] [(_.test (|> (#synthesis.Extension (list)) - (run (..sanitize )) + (run (..safe )) (//case.verify )))] ["lux f64 min" ("lux f64 min")] @@ -165,7 +165,7 @@ ["lux f64 smallest" ("lux f64 smallest")] )) (_.test "'lux f64 i64 && 'lux i64 f64'" - (|> (run (..sanitize "lux f64 i64") + (|> (run (..safe "lux f64 i64") (|> subject synthesis.f64 (list) (#synthesis.Extension "lux f64 i64") (list) (#synthesis.Extension "lux i64 f64"))) @@ -192,14 +192,14 @@ ($_ _.and (_.test "Can compare texts for equality." (and (|> (#synthesis.Extension "lux text =" (list sample-lowerS sample-lowerS)) - (run (..sanitize "lux text =")) + (run (..safe "lux text =")) (case> (#try.Success valueV) (:as Bit valueV) _ false)) (|> (#synthesis.Extension "lux text =" (list sample-upperS sample-lowerS)) - (run (..sanitize "lux text =")) + (run (..safe "lux text =")) (case> (#try.Success valueV) (not (:as Bit valueV)) @@ -207,7 +207,7 @@ false)))) (_.test "Can compare texts for order." (|> (#synthesis.Extension "lux text <" (list sample-lowerS sample-upperS)) - (run (..sanitize "lux text <")) + (run (..safe "lux text <")) (case> (#try.Success valueV) (:as Bit valueV) @@ -215,7 +215,7 @@ false))) (_.test "Can get length of text." (|> (#synthesis.Extension "lux text size" (list sample-lowerS)) - (run (..sanitize "lux text size")) + (run (..safe "lux text size")) (case> (#try.Success valueV) (n.= sample-size (:as Nat valueV)) @@ -223,7 +223,7 @@ false))) (_.test "Can concatenate text." (|> (#synthesis.Extension "lux text size" (list concatenatedS)) - (run (..sanitize "lux text size")) + (run (..safe "lux text size")) (case> (#try.Success valueV) (n.= (n.* 2 sample-size) (:as Nat valueV)) @@ -233,7 +233,7 @@ (and (|> (#synthesis.Extension "lux text index" (list concatenatedS sample-lowerS (synthesis.i64 +0))) - (run (..sanitize "lux text index")) + (run (..safe "lux text index")) (case> (^multi (#try.Success valueV) {(:as (Maybe Nat) valueV) (#.Some valueV)}) (n.= 0 valueV) @@ -243,7 +243,7 @@ (|> (#synthesis.Extension "lux text index" (list concatenatedS sample-upperS (synthesis.i64 +0))) - (run (..sanitize "lux text index")) + (run (..safe "lux text index")) (case> (^multi (#try.Success valueV) {(:as (Maybe Nat) valueV) (#.Some valueV)}) (n.= sample-size valueV) @@ -256,7 +256,7 @@ (list concatenatedS (synthesis.i64 offset) (synthesis.i64 length))) - (run (..sanitize "lux text clip")) + (run (..safe "lux text clip")) (case> (^multi (#try.Success valueV) {(:as (Maybe Text) valueV) (#.Some valueV)}) (text\= expected valueV) @@ -270,7 +270,7 @@ (|> (#synthesis.Extension "lux text char" (list sample-lowerS (synthesis.i64 char-idx))) - (run (..sanitize "lux text char")) + (run (..safe "lux text char")) (case> (^multi (#try.Success valueV) {(:as (Maybe Int) valueV) (#.Some valueV)}) (text.contains? ("lux i64 char" valueV) @@ -288,7 +288,7 @@ (_.test "Can log messages." (|> (#synthesis.Extension "lux io log" (list (synthesis.text (format "LOG: " message)))) - (run (..sanitize "lux io log")) + (run (..safe "lux io log")) (case> (#try.Success valueV) true @@ -301,7 +301,7 @@ #synthesis.arity 1 #synthesis.body (#synthesis.Extension "lux io error" (list (synthesis.text message)))}))) - (run (..sanitize "lux try")) + (run (..safe "lux try")) (case> (^multi (#try.Success valueV) {(:as (Try Text) valueV) (#try.Failure error)}) (text.contains? message error) @@ -313,7 +313,7 @@ {#synthesis.environment (list) #synthesis.arity 1 #synthesis.body (synthesis.text message)}))) - (run (..sanitize "lux try")) + (run (..safe "lux try")) (case> (^multi (#try.Success valueV) {(:as (Try Text) valueV) (#try.Success valueV)}) (text\= message valueV) @@ -323,7 +323,7 @@ (_.test "Can obtain current time in milli-seconds." (|> (synthesis.tuple (list (#synthesis.Extension "lux io current-time" (list)) (#synthesis.Extension "lux io current-time" (list)))) - (run (..sanitize "lux io current-time")) + (run (..safe "lux io current-time")) (case> (#try.Success valueV) (let [[pre post] (:as [Nat Nat] valueV)] (n.>= pre post)) diff --git a/stdlib/source/specification/compositor/generation/structure.lux b/stdlib/source/specification/compositor/generation/structure.lux index c8482aff2..355b98409 100644 --- a/stdlib/source/specification/compositor/generation/structure.lux +++ b/stdlib/source/specification/compositor/generation/structure.lux @@ -76,7 +76,7 @@ (and (n.= size (array.size tuple-out)) (list.every? (function (_ [left right]) (i.= left (:as Int right))) - (list.zip/2 tuple-in (array.to_list tuple-out))))) + (list.zipped/2 tuple-in (array.to_list tuple-out))))) (#try.Failure _) false))))) -- cgit v1.2.3