diff options
Diffstat (limited to '')
-rw-r--r-- | stdlib/source/spec/compositor/generation/common.lux | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/stdlib/source/spec/compositor/generation/common.lux b/stdlib/source/spec/compositor/generation/common.lux index b7a114893..c2289571a 100644 --- a/stdlib/source/spec/compositor/generation/common.lux +++ b/stdlib/source/spec/compositor/generation/common.lux @@ -10,6 +10,7 @@ ["." bit ("#@." equivalence)] [number ["." i64] + ["n" nat] ["i" int] ["f" frac]] ["." text ("#@." equivalence) @@ -42,7 +43,7 @@ (synthesis.i64 subject))) (run (..sanitize <extension>)) (case> (#try.Success valueT) - (n/= (<reference> param subject) (:coerce Nat valueT)) + (n.= (<reference> param subject) (:coerce Nat valueT)) (#try.Failure _) false) @@ -51,8 +52,8 @@ ["lux i64 and" i64.and param] ["lux i64 or" i64.or param] ["lux i64 xor" i64.xor param] - ["lux i64 left-shift" i64.left-shift (n/% 64 param)] - ["lux i64 logical-right-shift" i64.logic-right-shift (n/% 64 param)] + ["lux i64 left-shift" i64.left-shift (n.% 64 param)] + ["lux i64 logical-right-shift" i64.logic-right-shift (n.% 64 param)] )] ($_ _.and <binary> @@ -68,7 +69,7 @@ (#try.Failure _) false) - (let [param (n/% 64 param)]))) + (let [param (n.% 64 param)]))) )))) (def: (i64 run) @@ -91,7 +92,7 @@ ["lux i64 f64" Frac i.frac f.= subject] ["lux i64 char" Text (|>> (:coerce Nat) text.from-code) text@= (|> subject (:coerce Nat) - (n/% (i64.left-shift 8 1)) + (n.% (i64.left-shift 8 1)) (:coerce Int))] )) (~~ (template [<extension> <reference> <outputT> <comp>] @@ -117,7 +118,7 @@ (def: simple-frac (Random Frac) - (|> r.nat (:: r.monad map (|>> (n/% 1000) .int i.frac)))) + (|> r.nat (:: r.monad map (|>> (n.% 1000) .int i.frac)))) (def: (f64 run) (-> Runner Test) @@ -174,12 +175,12 @@ (def: (text run) (-> Runner Test) (do r.monad - [sample-size (|> r.nat (:: @ map (|>> (n/% 10) (n/max 1)))) + [sample-size (|> r.nat (:: @ map (|>> (n.% 10) (n.max 1)))) sample-lower (r.ascii/lower-alpha sample-size) sample-upper (r.ascii/upper-alpha sample-size) sample-alpha (|> (r.ascii/alpha sample-size) (r.filter (|>> (text@= sample-upper) not))) - char-idx (|> r.nat (:: @ map (n/% sample-size))) + char-idx (|> r.nat (:: @ map (n.% sample-size))) #let [sample-lowerS (synthesis.text sample-lower) sample-upperS (synthesis.text sample-upper) sample-alphaS (synthesis.text sample-alpha) @@ -216,7 +217,7 @@ (|> (#synthesis.Extension "lux text size" (list sample-lowerS)) (run (..sanitize "lux text size")) (case> (#try.Success valueV) - (n/= sample-size (:coerce Nat valueV)) + (n.= sample-size (:coerce Nat valueV)) _ false))) @@ -224,7 +225,7 @@ (|> (#synthesis.Extension "lux text size" (list concatenatedS)) (run (..sanitize "lux text size")) (case> (#try.Success valueV) - (n/= (n/* 2 sample-size) (:coerce Nat valueV)) + (n.= (n.* 2 sample-size) (:coerce Nat valueV)) _ false))) @@ -235,7 +236,7 @@ (run (..sanitize "lux text index")) (case> (^multi (#try.Success valueV) [(:coerce (Maybe Nat) valueV) (#.Some valueV)]) - (n/= 0 valueV) + (n.= 0 valueV) _ false)) @@ -245,7 +246,7 @@ (run (..sanitize "lux text index")) (case> (^multi (#try.Success valueV) [(:coerce (Maybe Nat) valueV) (#.Some valueV)]) - (n/= sample-size valueV) + (n.= sample-size valueV) _ false)))) @@ -264,7 +265,7 @@ false))))] (_.test "Can clip text to extract sub-text." (and (test-clip 0 sample-size sample-lower) - (test-clip sample-size (n/* 2 sample-size) sample-upper)))) + (test-clip sample-size (n.* 2 sample-size) sample-upper)))) (_.test "Can extract individual characters from text." (|> (#synthesis.Extension "lux text char" (list sample-lowerS @@ -325,7 +326,7 @@ (run (..sanitize "lux io current-time")) (case> (#try.Success valueV) (let [[pre post] (:coerce [Nat Nat] valueV)] - (n/>= pre post)) + (n.>= pre post)) (#try.Failure _) false))) |