aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/unsafe
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/unsafe
parent1a962ee4b03f51f46a5979bfefc954f35ee3a1b7 (diff)
Now demanding mandatory loop names, instead of using default "again" name.
Diffstat (limited to 'stdlib/source/unsafe')
-rw-r--r--stdlib/source/unsafe/lux/data/binary.lux4
-rw-r--r--stdlib/source/unsafe/lux/data/collection/array.lux34
2 files changed, 19 insertions, 19 deletions
diff --git a/stdlib/source/unsafe/lux/data/binary.lux b/stdlib/source/unsafe/lux/data/binary.lux
index 0dd650ec2..bc99f1f55 100644
--- a/stdlib/source/unsafe/lux/data/binary.lux
+++ b/stdlib/source/unsafe/lux/data/binary.lux
@@ -283,7 +283,7 @@
sample <sample>
limit (..size reference)]
(.and ("lux i64 =" limit (..size sample))
- (.loop [index 0]
+ (.loop (again [index 0])
(.if ("lux i64 =" limit index)
.true
(.and ("lux i64 ="
@@ -304,7 +304,7 @@
(~~ (.static @.jvm)) <jvm>
... Default
- (.loop [index 0]
+ (.loop (again [index 0])
(.if ("lux i64 <" (.int bytes) (.int index))
(.exec
(..with/1! ("lux i64 +" target_offset index)
diff --git a/stdlib/source/unsafe/lux/data/collection/array.lux b/stdlib/source/unsafe/lux/data/collection/array.lux
index 3897dd399..e66d3ca3b 100644
--- a/stdlib/source/unsafe/lux/data/collection/array.lux
+++ b/stdlib/source/unsafe/lux/data/collection/array.lux
@@ -186,7 +186,7 @@
(.-> .Nat .Nat (..Array a) .Nat (..Array a)
(..Array a)))
(.function (copy! length src_start src_array dest_start dest_array)
- (.loop [offset 0]
+ (.loop (again [offset 0])
(.if ("lux i64 <" (.int length) (.int offset))
(.exec
(.if (..lacks? ("lux i64 +" offset src_start) src_array)
@@ -203,8 +203,8 @@
[((.is (.All (_ a) (.-> (..Array a) .Nat))
(.function (occupancy array)
(.let [size (..size array)]
- (.loop [index 0
- it 0]
+ (.loop (again [index 0
+ it 0])
(.if ("lux i64 <" (.int size) (.int index))
(.if (..lacks? index array)
(again ("lux i64 +" 1 index) <when_lacks>)
@@ -221,7 +221,7 @@
(.-> (.-> a .Bit) (..Array a) (..Array a)))
(.function (only! ? it)
(.let [size (..size it)]
- (.loop [index 0]
+ (.loop (again [index 0])
(.if ("lux i64 <" (.int size) (.int index))
(.exec
(.if (..lacks? index it)
@@ -239,7 +239,7 @@
(.-> <predicate> (..Array a) (.Maybe <type>)))
(.function (<name> ? it)
(.let [size (..size it)]
- (.loop [index 0]
+ (.loop (again [index 0])
(.if ("lux i64 <" (.int size) (.int index))
(.if (..lacks? index it)
(again ("lux i64 +" 1 index))
@@ -266,8 +266,8 @@
(.function (of_list input)
(.let [size (list.size input)
output (..empty size)]
- (.loop [index 0
- input input]
+ (.loop (again [index 0
+ input input])
(.case input
{.#End}
output
@@ -285,8 +285,8 @@
(`` (template: (list|-default <empty> <array>)
[((.is (.All (_ a) (.-> (.List a) (..Array a) (.List a)))
(.function (list|-default empty array)
- (.loop [index ("lux i64 -" 1 (..size array))
- output empty]
+ (.loop (again [index ("lux i64 -" 1 (..size array))
+ output empty])
(.if ("lux i64 =" (~~ (.static ..underflow)) index)
output
(again ("lux i64 -" 1 index)
@@ -298,9 +298,9 @@
(`` (template: (list|+default <default> <array>)
[((.is (.All (_ a) (.-> a (..Array a) (.List a)))
(.function (list|+default default array)
- (.loop [index ("lux i64 -" 1 (..size array))
- output (`` (.is (.List (~~ (.these (~~ (.type_of default)))))
- {.#End}))]
+ (.loop (again [index ("lux i64 -" 1 (..size array))
+ output (`` (.is (.List (~~ (.these (~~ (.type_of default)))))
+ {.#End}))])
(.if ("lux i64 =" (~~ (.static ..underflow)) index)
output
(again ("lux i64 -" 1 index)
@@ -326,7 +326,7 @@
(.function (= //#= left/* right/*)
(.let [size (..size left/*)]
(.and ("lux i64 =" (..size right/*) size)
- (.loop [index 0]
+ (.loop (again [index 0])
(.if ("lux i64 <" (.int size) (.int index))
(.if (..lacks? index left/*)
(..lacks? index right/*)
@@ -353,8 +353,8 @@
(.-> (.-> Nat b a a) a (..Array b) a))
(.function (mix $ init it)
(.let [size (..size it)]
- (.loop [index 0
- so_far init]
+ (.loop (again [index 0
+ so_far init])
(.if ("lux i64 <" (.int size) (.int index))
(.if (..lacks? index it)
(again ("lux i64 +" 1 index) so_far)
@@ -378,7 +378,7 @@
(.-> (..Array a) .Bit)))
(.function (<name> ? it)
(.let [size (..size it)]
- (.loop [index 0]
+ (.loop (again [index 0])
(.if ("lux i64 <" (.int size) (.int index))
(.if (..lacks? index it)
(again ("lux i64 +" 1 index))
@@ -396,7 +396,7 @@
(.-> (.-> a (.Maybe b)) (..Array a) (.Maybe b)))
(.function (one ? it)
(.let [size (..size it)]
- (.loop [index 0]
+ (.loop (again [index 0])
(.if ("lux i64 <" (.int size) (.int index))
(with_expansions [<again> (again ("lux i64 +" 1 index))]
(.if (..lacks? index it)