aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/test/lux/control
diff options
context:
space:
mode:
Diffstat (limited to 'stdlib/source/test/lux/control')
-rw-r--r--stdlib/source/test/lux/control/function/memo.lux10
-rw-r--r--stdlib/source/test/lux/control/function/mixin.lux28
-rw-r--r--stdlib/source/test/lux/control/parser/binary.lux8
3 files changed, 23 insertions, 23 deletions
diff --git a/stdlib/source/test/lux/control/function/memo.lux b/stdlib/source/test/lux/control/function/memo.lux
index b1b559346..6ad5b243a 100644
--- a/stdlib/source/test/lux/control/function/memo.lux
+++ b/stdlib/source/test/lux/control/function/memo.lux
@@ -25,14 +25,14 @@
["/[1]" // "_"
["[1]" mixin]]]])
-(def: (fibonacci recur input)
+(def: (fibonacci again input)
(/.Memo Nat Nat)
(case input
0 (state#in 0)
1 (state#in 1)
_ (do state.monad
- [output_1 (recur (n.- 1 input))
- output_2 (recur (n.- 2 input))]
+ [output_1 (again (n.- 1 input))
+ output_2 (again (n.- 2 input))]
(in (n.+ output_1 output_2)))))
(def: (time function input)
@@ -104,11 +104,11 @@
(let [memo (<| //.fixed
(//.mixed /.memoization)
(: (//.Mixin Nat (State (Dictionary Nat Nat) Nat))
- (function (factorial delegate recur input)
+ (function (factorial delegate again input)
(case input
(^or 0 1) (# state.monad in 1)
_ (do state.monad
- [output' (recur (-- input))]
+ [output' (again (-- input))]
(in (n.* input output')))))))
expected (|> (list.indices input)
(list#each ++)
diff --git a/stdlib/source/test/lux/control/function/mixin.lux b/stdlib/source/test/lux/control/function/mixin.lux
index fa1c245a3..4fc898500 100644
--- a/stdlib/source/test/lux/control/function/mixin.lux
+++ b/stdlib/source/test/lux/control/function/mixin.lux
@@ -36,7 +36,7 @@
generator (: (Random (/.Mixin Nat Nat))
(do !
[output random.nat]
- (in (function (_ delegate recur input)
+ (in (function (_ delegate again input)
output))))
expected (|> (list.indices input)
(list#each ++)
@@ -49,27 +49,27 @@
(_.cover [/.fixed]
(let [factorial (/.fixed
- (function (_ delegate recur input)
+ (function (_ delegate again input)
(case input
(^or 0 1) 1
- _ (n.* input (recur (-- input))))))]
+ _ (n.* input (again (-- input))))))]
(n.= expected
(factorial input))))
(_.cover [/.mixed]
(let [bottom (: (/.Mixin Nat Nat)
- (function (_ delegate recur input)
+ (function (_ delegate again input)
(case input
(^or 0 1) 1
_ (delegate input))))
multiplication (: (/.Mixin Nat Nat)
- (function (_ delegate recur input)
- (n.* input (recur (-- input)))))
+ (function (_ delegate again input)
+ (n.* input (again (-- input)))))
factorial (/.fixed (/.mixed bottom multiplication))]
(n.= expected
(factorial input))))
(_.cover [/.nothing]
(let [loop (: (/.Mixin Nat Nat)
- (function (_ delegate recur input)
+ (function (_ delegate again input)
(case input
(^or 0 1) 1
_ (n.* input (delegate (-- input))))))
@@ -81,7 +81,7 @@
(right input)))))
(_.cover [/.advice]
(let [bottom (: (/.Mixin Nat Nat)
- (function (_ delegate recur input)
+ (function (_ delegate again input)
1))
bottom? (: (Predicate Nat)
(function (_ input)
@@ -89,8 +89,8 @@
(^or 0 1) true
_ false)))
multiplication (: (/.Mixin Nat Nat)
- (function (_ delegate recur input)
- (n.* input (recur (-- input)))))
+ (function (_ delegate again input)
+ (n.* input (again (-- input)))))
factorial (/.fixed (/.mixed (/.advice bottom? bottom)
multiplication))]
(n.= expected
@@ -101,7 +101,7 @@
(function (_ state)
[shift []])))
meld (: (/.Mixin Nat (State Nat Nat))
- (function (_ delegate recur input)
+ (function (_ delegate again input)
(function (_ state)
[state (n.+ state input)])))
function (/.fixed (/.mixed (/.before state.monad implant)
@@ -114,7 +114,7 @@
(function (_ state)
[shift []])))
meld (: (/.Mixin Nat (State Nat Nat))
- (function (_ delegate recur input)
+ (function (_ delegate again input)
(function (_ state)
[state (n.+ state input)])))
function (/.fixed (/.mixed (/.after state.monad implant)
@@ -126,10 +126,10 @@
(_.cover [/.of_recursive]
(let [factorial (/.fixed
(/.of_recursive
- (function (_ recur input)
+ (function (_ again input)
(case input
(^or 0 1) 1
- _ (n.* input (recur (-- input)))))))]
+ _ (n.* input (again (-- input)))))))]
(n.= expected
(factorial input)))))
)))
diff --git a/stdlib/source/test/lux/control/parser/binary.lux b/stdlib/source/test/lux/control/parser/binary.lux
index 3bf3363c9..e878f916f 100644
--- a/stdlib/source/test/lux/control/parser/binary.lux
+++ b/stdlib/source/test/lux/control/parser/binary.lux
@@ -91,10 +91,10 @@
(def: random_code
(Random Code)
(random.rec
- (function (_ recur)
+ (function (_ again)
(let [random_sequence (do [! random.monad]
[size (# ! each (n.% 2) random.nat)]
- (random.list size recur))]
+ (random.list size again))]
($_ random.and
..random_location
(: (Random (Code' (Ann Location)))
@@ -306,10 +306,10 @@
(format.or format.any))))
(/.result (: (/.Parser (List Nat))
(/.rec
- (function (_ recur)
+ (function (_ again)
(/.or /.any
(<>.and /.nat
- recur))))))
+ again))))))
(!expect (^multi {try.#Success actual}
(# (list.equivalence n.equivalence) =
expected