aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/specification/compositor/generation/function.lux
diff options
context:
space:
mode:
authorEduardo Julian2021-07-28 04:48:42 -0400
committerEduardo Julian2021-07-28 04:48:42 -0400
commit5d4583aebd00adced10275b32ff1a93ab418be50 (patch)
tree89315e104e2b0ddd6d56f894f01a0575d3078699 /stdlib/source/specification/compositor/generation/function.lux
parent061fd8a209bbcaffc2bfb850ac6046752a567d50 (diff)
Re-named List's tags: Nil => End && Cons => Item
Diffstat (limited to 'stdlib/source/specification/compositor/generation/function.lux')
-rw-r--r--stdlib/source/specification/compositor/generation/function.lux30
1 files changed, 15 insertions, 15 deletions
diff --git a/stdlib/source/specification/compositor/generation/function.lux b/stdlib/source/specification/compositor/generation/function.lux
index 61f6d6656..5a5891088 100644
--- a/stdlib/source/specification/compositor/generation/function.lux
+++ b/stdlib/source/specification/compositor/generation/function.lux
@@ -24,13 +24,13 @@
[//
[common (#+ Runner)]]])
-(def: max-arity
+(def: max_arity
Arity
10)
(def: arity
(Random Arity)
- (|> r.nat (r\map (|>> (n.% max-arity) (n.max 1)))))
+ (|> r.nat (r\map (|>> (n.% max_arity) (n.max 1)))))
(def: (local arity)
(-> Arity (Random Register))
@@ -51,45 +51,45 @@
(-> Runner Test)
(do {! r.monad}
[[arity local functionS] ..function
- partial-arity (|> r.nat (\ ! map (|>> (n.% arity) (n.max 1))))
- inputs (r.list arity r.safe-frac)
+ partial_arity (|> r.nat (\ ! map (|>> (n.% arity) (n.max 1))))
+ inputs (r.list arity r.safe_frac)
#let [expectation (maybe.assume (list.nth (dec local) inputs))
inputsS (list\map (|>> synthesis.f64) inputs)]]
($_ _.and
(_.test "Can read arguments."
(|> (synthesis.function/apply {#synthesis.function functionS
#synthesis.arguments inputsS})
- (run "with-local")
+ (run "with_local")
(//case.verify expectation)))
(_.test "Can partially apply functions."
(or (n.= 1 arity)
- (let [preS (list.take partial-arity inputsS)
- postS (list.drop partial-arity inputsS)
+ (let [preS (list.take partial_arity inputsS)
+ postS (list.drop partial_arity inputsS)
partialS (synthesis.function/apply {#synthesis.function functionS
#synthesis.arguments preS})]
(|> (synthesis.function/apply {#synthesis.function partialS
#synthesis.arguments postS})
- (run "partial-application")
+ (run "partial_application")
(//case.verify expectation)))))
(_.test "Can read environment."
(or (n.= 1 arity)
- (let [environment (|> partial-arity
+ (let [environment (|> partial_arity
(enum.range n.enum 1)
(list\map (|>> #reference.Local)))
- variableS (if (n.<= partial-arity local)
+ variableS (if (n.<= partial_arity local)
(synthesis.variable/foreign (dec local))
- (synthesis.variable/local (|> local (n.- partial-arity))))
- inner-arity (n.- partial-arity arity)
+ (synthesis.variable/local (|> local (n.- partial_arity))))
+ inner_arity (n.- partial_arity arity)
innerS (synthesis.function/abstraction
{#synthesis.environment environment
- #synthesis.arity inner-arity
+ #synthesis.arity inner_arity
#synthesis.body variableS})
outerS (synthesis.function/abstraction
{#synthesis.environment (list)
- #synthesis.arity partial-arity
+ #synthesis.arity partial_arity
#synthesis.body innerS})]
(|> (synthesis.function/apply {#synthesis.function outerS
#synthesis.arguments inputsS})
- (run "with-foreign")
+ (run "with_foreign")
(//case.verify expectation)))))
)))