aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/library/lux/math/number/nat.lux
diff options
context:
space:
mode:
authorEduardo Julian2022-03-30 14:05:57 -0400
committerEduardo Julian2022-03-30 14:05:57 -0400
commit381ec5920d9ebeb335963778dec182268819e718 (patch)
tree5c9288c5fbb16c21a0f00f96710b0aa7db4585f4 /stdlib/source/library/lux/math/number/nat.lux
parent1a962ee4b03f51f46a5979bfefc954f35ee3a1b7 (diff)
Now demanding mandatory loop names, instead of using default "again" name.
Diffstat (limited to '')
-rw-r--r--stdlib/source/library/lux/math/number/nat.lux16
1 files changed, 8 insertions, 8 deletions
diff --git a/stdlib/source/library/lux/math/number/nat.lux b/stdlib/source/library/lux/math/number/nat.lux
index 31537c887..da1670111 100644
--- a/stdlib/source/library/lux/math/number/nat.lux
+++ b/stdlib/source/library/lux/math/number/nat.lux
@@ -292,8 +292,8 @@
(def: encoded
(let [mask (|> 1 ("lux i64 left-shift" <shift>) --)]
(function (_ value)
- (loop [input value
- output ""]
+ (loop (again [input value
+ output ""])
(let [output' ("lux text concat"
(<to_character> ("lux i64 and" mask input))
output)]
@@ -307,8 +307,8 @@
(def: (decoded repr)
(let [input_size ("lux text size" repr)]
(if (..> 0 input_size)
- (loop [idx 0
- output 0]
+ (loop (again [idx 0
+ output 0])
(if (..< input_size idx)
(case (<to_value> ("lux text char" idx repr))
{.#Some digit_value}
@@ -331,8 +331,8 @@
(Codec Text Nat)
(def: (encoded value)
- (loop [input value
- output ""]
+ (loop (again [input value
+ output ""])
(let [digit (decimal_character (..% 10 input))
output' ("lux text concat" digit output)]
(case (../ 10 input)
@@ -346,8 +346,8 @@
(let [input_size ("lux text size" repr)]
(with_expansions [<failure> {try.#Failure ("lux text concat" "Invalid decimal syntax for Nat: " repr)}]
(if (..> 0 input_size)
- (loop [idx 0
- output 0]
+ (loop (again [idx 0
+ output 0])
(if (..< input_size idx)
(case (decimal_value ("lux text char" idx repr))
{.#None}