diff options
Diffstat (limited to 'stdlib/source/library/lux/data')
18 files changed, 73 insertions, 73 deletions
diff --git a/stdlib/source/library/lux/data/binary.lux b/stdlib/source/library/lux/data/binary.lux index e747e40b1..b5530923d 100644 --- a/stdlib/source/library/lux/data/binary.lux +++ b/stdlib/source/library/lux/data/binary.lux @@ -192,7 +192,7 @@ (loop [index 0 output init] (if (n.< size index) - (recur (++ index) (f (!read index binary) output)) + (again (++ index) (f (!read index binary) output)) output)))) (def: .public (read/8! index binary) @@ -295,7 +295,7 @@ (if (n.< limit index) (and (n.= (!read index reference) (!read index sample)) - (recur (++ index))) + (again (++ index))) true)))))))) (for [@.old (as_is) @@ -328,7 +328,7 @@ (exec (!write (n.+ target_offset index) (!read (n.+ source_offset index) source) target) - (recur (++ index))) + (again (++ index))) {try.#Success target}))))))) (def: .public (slice offset length binary) diff --git a/stdlib/source/library/lux/data/collection/array.lux b/stdlib/source/library/lux/data/collection/array.lux index 766213cea..2fe33d2e1 100644 --- a/stdlib/source/library/lux/data/collection/array.lux +++ b/stdlib/source/library/lux/data/collection/array.lux @@ -227,12 +227,12 @@ (if (n.< arr_size idx) (case (read! idx xs) {.#None} - (recur (++ idx)) + (again (++ idx)) {.#Some x} (if (p x) {.#Some x} - (recur (++ idx)))) + (again (++ idx)))) {.#None})))) (def: .public (example+ p xs) @@ -243,12 +243,12 @@ (if (n.< arr_size idx) (case (read! idx xs) {.#None} - (recur (++ idx)) + (again (++ idx)) {.#Some x} (if (p idx x) {.#Some [idx x]} - (recur (++ idx)))) + (again (++ idx)))) {.#None})))) (def: .public (clone xs) @@ -284,7 +284,7 @@ output _ - (recur (-- idx) + (again (-- idx) (case (read! idx array) {.#Some head} {.#Item head output} @@ -301,7 +301,7 @@ output _ - (recur (-- idx) + (again (-- idx) {.#Item (maybe.else default (read! idx array)) output})))) @@ -375,10 +375,10 @@ (if (n.< arr_size idx) (case (read! idx xs) {.#None} - (recur so_far (++ idx)) + (again so_far (++ idx)) {.#Some value} - (recur (f value so_far) (++ idx))) + (again (f value so_far) (++ idx))) so_far))))) (template [<name> <init> <op>] @@ -392,10 +392,10 @@ (case (..read! idx array) {.#Some value} (<op> (predicate value) - (recur (++ idx))) + (again (++ idx))) {.#None} - (recur (++ idx))) + (again (++ idx))) <init>)))))] [every? true and] diff --git a/stdlib/source/library/lux/data/collection/bits.lux b/stdlib/source/library/lux/data/collection/bits.lux index 3db996fdf..b2fbeced2 100644 --- a/stdlib/source/library/lux/data/collection/bits.lux +++ b/stdlib/source/library/lux/data/collection/bits.lux @@ -78,7 +78,7 @@ .nat) 0 ... TODO: Remove 'no_op' once new-luxc is the official compiler. - (let [no_op (recur (-- size|output) output)] + (let [no_op (again (-- size|output) output)] no_op) chunk @@ -86,7 +86,7 @@ (: Bits (array.empty size|output)) output) (array.write! idx|output (.i64 chunk)) - (recur (-- size|output)))) + (again (-- size|output)))) output)))))] [one i64.one] @@ -104,7 +104,7 @@ (i64.and (..chunk idx reference)) ("lux i64 =" empty_chunk) .not) - (recur (++ idx))) + (again (++ idx))) #0)))) (def: .public (not input) @@ -119,7 +119,7 @@ (let [idx (-- size|output)] (case (|> input (..chunk idx) i64.not .nat) 0 - (recur (-- size|output) output) + (again (-- size|output) output) chunk (if (n.> 0 size|output) @@ -127,7 +127,7 @@ (: Bits (array.empty size|output)) output) (array.write! idx (.i64 chunk)) - (recur (-- size|output))) + (again (-- size|output))) output)))))) (template [<name> <op>] @@ -147,14 +147,14 @@ (<op> (..chunk idx param)) .nat) 0 - (recur (-- size|output) output) + (again (-- size|output) output) chunk (|> (if (same? ..empty output) (: Bits (array.empty size|output)) output) (array.write! idx (.i64 chunk)) - (recur (-- size|output)))) + (again (-- size|output)))) output)))))] [and i64.and] @@ -173,5 +173,5 @@ (.and ("lux i64 =" (..chunk idx reference) (..chunk idx sample)) - (recur (++ idx))) + (again (++ idx))) #1))))) diff --git a/stdlib/source/library/lux/data/collection/dictionary/ordered.lux b/stdlib/source/library/lux/data/collection/dictionary/ordered.lux index 9b4b308b7..9ef4d8686 100644 --- a/stdlib/source/library/lux/data/collection/dictionary/ordered.lux +++ b/stdlib/source/library/lux/data/collection/dictionary/ordered.lux @@ -73,10 +73,10 @@ (# dict < node_key key) ... (_#< node_key key) - (recur (value@ #left node)) + (again (value@ #left node)) ... (_#> (value@ #key node) key) - (recur (value@ #right node)))) + (again (value@ #right node)))) )))) ... TODO: Doing inneficient access of Order functions due to compiler bug. @@ -96,8 +96,8 @@ ... (_#= node_key key) (if (# dict < node_key key) ... (_#< node_key key) - (recur (value@ #left node)) - (recur (value@ #right node))))))))) + (again (value@ #left node)) + (again (value@ #right node))))))))) (template [<name> <side>] [(def: .public (<name> dict) @@ -113,7 +113,7 @@ {.#Some (value@ #value node)} {.#Some side} - (recur side)))))] + (again side)))))] [min #left] [max #right] @@ -127,8 +127,8 @@ 0 {.#Some node} - (++ (n.+ (recur (value@ #left node)) - (recur (value@ #right node))))))) + (++ (n.+ (again (value@ #left node)) + (again (value@ #right node))))))) (def: .public empty? (All (_ k v) (-> (Dictionary k v) Bit)) @@ -260,7 +260,7 @@ (`` (cond (~~ (template [<comp> <tag> <add>] [(<comp> reference key) (let [side_root (value@ <tag> root) - outcome (recur side_root)] + outcome (again side_root)] (if (same? side_root outcome) ?root {.#Some (<add> (maybe.trusted outcome) @@ -486,7 +486,7 @@ (value@ #right root)) #1] (let [go_left? (_#< root_key key)] - (case (recur (if go_left? + (case (again (if go_left? (value@ #left root) (value@ #right root))) [{.#None} #0] @@ -551,9 +551,9 @@ {.#Some node'} ($_ list#composite - (recur (value@ #left node')) + (again (value@ #left node')) (list <output>) - (recur (value@ #right node'))))))] + (again (value@ #right node'))))))] [entries [k v] [(value@ #key node') (value@ #value node')]] [keys k (value@ #key node')] @@ -574,7 +574,7 @@ [{.#Item [keyR valueR] entriesR'} {.#Item [keyS valueS] entriesS'}] (and (/#= keyR keyS) (,#= valueR valueS) - (recur entriesR' entriesS')) + (again entriesR' entriesS')) _ #0))))) diff --git a/stdlib/source/library/lux/data/collection/list.lux b/stdlib/source/library/lux/data/collection/list.lux index 6860eb4d6..6166724c7 100644 --- a/stdlib/source/library/lux/data/collection/list.lux +++ b/stdlib/source/library/lux/data/collection/list.lux @@ -449,7 +449,7 @@ input' (n./ 10 input)] (case input' 0 output' - _ (recur input' output'))))) + _ (again input' output'))))) (macro: .public (zipped tokens state) (case tokens @@ -602,7 +602,7 @@ {.#End} {.#Item x xs'} - {.#Item [idx x] (recur (++ idx) xs')}))) + {.#Item [idx x] (again (++ idx) xs')}))) (macro: .public (when tokens state) (case tokens diff --git a/stdlib/source/library/lux/data/collection/queue/priority.lux b/stdlib/source/library/lux/data/collection/queue/priority.lux index 52cd3929a..4766683b8 100644 --- a/stdlib/source/library/lux/data/collection/queue/priority.lux +++ b/stdlib/source/library/lux/data/collection/queue/priority.lux @@ -64,7 +64,7 @@ 1 {0 #1 [left right]} - (n.+ (recur left) (recur right)))))) + (n.+ (again left) (again right)))))) (def: .public (member? equivalence queue member) (All (_ a) (-> (Equivalence a) (Queue a) a Bit)) @@ -79,8 +79,8 @@ (# equivalence = reference member) {0 #1 [left right]} - (or (recur left) - (recur right)))))) + (or (again left) + (again right)))))) (def: .public (next queue) (All (_ a) (-> (Queue a) (Queue a))) @@ -97,13 +97,13 @@ {0 #1 left right} (if (n.= highest_priority (tree.tag left)) - (case (recur left) + (case (again left) {.#None} {.#Some right} {.#Some =left} {.#Some (# ..builder branch =left right)}) - (case (recur right) + (case (again right) {.#None} {.#Some left} diff --git a/stdlib/source/library/lux/data/collection/row.lux b/stdlib/source/library/lux/data/collection/row.lux index c1b3b6ece..ae8a99c37 100644 --- a/stdlib/source/library/lux/data/collection/row.lux +++ b/stdlib/source/library/lux/data/collection/row.lux @@ -262,7 +262,7 @@ (case [(n.> branching_exponent level) (array.read! (branch_idx (i64.right_shifted level idx)) hierarchy)] [#1 {.#Some {#Hierarchy sub}}] - (recur (level_down level) sub) + (again (level_down level) sub) [#0 {.#Some {#Base base}}] {try.#Success base} @@ -333,7 +333,7 @@ (if (n.> branching_exponent level) (case [(array.read! 1 root) (array.read! 0 root)] [{.#None} {.#Some {#Hierarchy sub_node}}] - (recur (level_down level) sub_node) + (again (level_down level) sub_node) ... [{.#None} {.#Some {#Base _}}] ... (undefined) diff --git a/stdlib/source/library/lux/data/collection/sequence.lux b/stdlib/source/library/lux/data/collection/sequence.lux index fbd998ae2..fcfe2d0ed 100644 --- a/stdlib/source/library/lux/data/collection/sequence.lux +++ b/stdlib/source/library/lux/data/collection/sequence.lux @@ -40,10 +40,10 @@ tail next] (//.pending [head (case tail {.#End} - (recur start next) + (again start next) {.#Item head' tail'} - (recur head' tail'))]))) + (again head' tail'))]))) (template [<name> <return>] [(def: .public (<name> sequence) diff --git a/stdlib/source/library/lux/data/collection/tree.lux b/stdlib/source/library/lux/data/collection/tree.lux index fe98bdfdf..7be4807e8 100644 --- a/stdlib/source/library/lux/data/collection/tree.lux +++ b/stdlib/source/library/lux/data/collection/tree.lux @@ -57,7 +57,7 @@ (syntax: .public (tree [root tree^]) (in (list (` (~ (loop [[value children] root] (` [#value (~ value) - #children (list (~+ (list#each recur children)))]))))))) + #children (list (~+ (list#each again children)))]))))))) (implementation: .public (equivalence super) (All (_ a) (-> (Equivalence a) (Equivalence (Tree a)))) diff --git a/stdlib/source/library/lux/data/collection/tree/finger.lux b/stdlib/source/library/lux/data/collection/tree/finger.lux index a82b78f96..90e929937 100644 --- a/stdlib/source/library/lux/data/collection/tree/finger.lux +++ b/stdlib/source/library/lux/data/collection/tree/finger.lux @@ -96,8 +96,8 @@ {0 #1 [left right]} (let [shifted_tag (tag//composite _tag (..tag left))] (if (predicate shifted_tag) - (recur _tag (value@ #root (:representation left))) - (recur shifted_tag (value@ #root (:representation right)))))))) + (again _tag (value@ #root (:representation left))) + (again shifted_tag (value@ #root (:representation right)))))))) {.#None}))) ) diff --git a/stdlib/source/library/lux/data/collection/tree/zipper.lux b/stdlib/source/library/lux/data/collection/tree/zipper.lux index 19581bb40..daeab670d 100644 --- a/stdlib/source/library/lux/data/collection/tree/zipper.lux +++ b/stdlib/source/library/lux/data/collection/tree/zipper.lux @@ -185,7 +185,7 @@ {.#None} (do maybe.monad [@ (..up @)] - (recur @)))))) + (again @)))))) (def: (bottom zipper) (All (_ a) (-> (Zipper a) (Zipper a))) @@ -229,7 +229,7 @@ {.#Some @} {.#Some @} - (recur @)))))] + (again @)))))] [end ..next] [start ..previous] diff --git a/stdlib/source/library/lux/data/format/binary.lux b/stdlib/source/library/lux/data/format/binary.lux index 94fdea2bc..abf28f5d0 100644 --- a/stdlib/source/library/lux/data/format/binary.lux +++ b/stdlib/source/library/lux/data/format/binary.lux @@ -105,8 +105,8 @@ (def: .public (rec body) (All (_ a) (-> (-> (Writer a) (Writer a)) (Writer a))) - (function (recur value) - (body recur value))) + (function (again value) + (body again value))) (def: .public any (Writer Any) @@ -226,10 +226,10 @@ (def: .public type (Writer Type) (..rec - (function (_ recur) - (let [pair (..and recur recur) + (function (_ again) + (let [pair (..and again again) indexed ..nat - quantified (..and (..list recur) recur)] + quantified (..and (..list again) again)] (function (_ altV) (case altV (^template [<number> <tag> <writer>] @@ -242,7 +242,7 @@ try.trusted [(.++ offset)] caseT))])]) - ([0 .#Primitive (..and ..text (..list recur))] + ([0 .#Primitive (..and ..text (..list again))] [1 .#Sum pair] [2 .#Product pair] [3 .#Function pair] @@ -252,7 +252,7 @@ [7 .#UnivQ quantified] [8 .#ExQ quantified] [9 .#Apply pair] - [10 .#Named (..and ..symbol recur)]) + [10 .#Named (..and ..symbol again)]) )))))) (def: .public location @@ -262,8 +262,8 @@ (def: .public code (Writer Code) (..rec - (function (_ recur) - (let [sequence (..list recur)] + (function (_ again) + (let [sequence (..list again)] (..and ..location (function (_ altV) (case altV diff --git a/stdlib/source/library/lux/data/format/json.lux b/stdlib/source/library/lux/data/format/json.lux index 0a160e2ff..56400e0ca 100644 --- a/stdlib/source/library/lux/data/format/json.lux +++ b/stdlib/source/library/lux/data/format/json.lux @@ -386,7 +386,7 @@ (if (text#= "\" stop) (do ! [escaped escaped_parser - next_chars (recur [])] + next_chars (again [])] (in ($_ text#composite chars escaped next_chars))) (in chars)))) diff --git a/stdlib/source/library/lux/data/format/tar.lux b/stdlib/source/library/lux/data/format/tar.lux index fdc3c0022..dd511524b 100644 --- a/stdlib/source/library/lux/data/format/tar.lux +++ b/stdlib/source/library/lux/data/format/tar.lux @@ -238,7 +238,7 @@ [last_char (binary.read/8! end string)] (`` (case (.nat last_char) (^ (char (~~ (static ..null)))) - (recur (-- end)) + (again (-- end)) _ (binary.slice 0 (++ end) string)))))))) diff --git a/stdlib/source/library/lux/data/format/xml.lux b/stdlib/source/library/lux/data/format/xml.lux index ec9516eb5..265b05516 100644 --- a/stdlib/source/library/lux/data/format/xml.lux +++ b/stdlib/source/library/lux/data/format/xml.lux @@ -268,7 +268,7 @@ ($_ text#composite prefix "<" tag attrs "/>") ($_ text#composite prefix "<" tag attrs ">" (|> xml_children - (list#each (|>> (recur (text#composite prefix text.tab)) (text#composite text.new_line))) + (list#each (|>> (again (text#composite prefix text.tab)) (text#composite text.new_line))) text.together) text.new_line prefix "</" tag ">"))))) )))) diff --git a/stdlib/source/library/lux/data/text.lux b/stdlib/source/library/lux/data/text.lux index 9a475bae4..ee72cef3e 100644 --- a/stdlib/source/library/lux/data/text.lux +++ b/stdlib/source/library/lux/data/text.lux @@ -75,7 +75,7 @@ output {.#Some offset'} - (recur (++ offset') output'))))) + (again (++ offset') output'))))) (def: .public (starts_with? prefix x) (-> Text Text Bit) @@ -168,7 +168,7 @@ {.#Some [pre post]} (|> output {.#Item pre} - (recur post)) + (again post)) {.#None} (|> output @@ -220,7 +220,7 @@ right template] (case (..split_by pattern right) {.#Some [pre post]} - (recur ($_ "lux text concat" left pre replacement) post) + (again ($_ "lux text concat" left pre replacement) post) {.#None} ("lux text concat" left right))))) @@ -273,7 +273,7 @@ (loop [index 0 hash 0] (if (n.< length index) - (recur (++ index) + (again (++ index) (|> hash (i64.left_shifted 5) (n.- hash) diff --git a/stdlib/source/library/lux/data/text/escape.lux b/stdlib/source/library/lux/data/text/escape.lux index 33d2d0a9e..ffefa4ade 100644 --- a/stdlib/source/library/lux/data/text/escape.lux +++ b/stdlib/source/library/lux/data/text/escape.lux @@ -120,7 +120,7 @@ (^template [<char> <replacement>] [(^ (static <char>)) (let [[previous' current' limit'] (ascii_escaped <replacement> offset limit previous current)] - (recur 0 previous' current' limit'))]) + (again 0 previous' current' limit'))]) ([..\0 ..escaped_\0] [..\a ..escaped_\a] [..\b ..escaped_\b] @@ -136,8 +136,8 @@ (if (or (n.< ..ascii_bottom char) (n.> ..ascii_top char)) (let [[previous' current' limit'] (unicode_escaped char offset limit previous current)] - (recur 0 previous' current' limit')) - (recur (++ offset) previous current limit))) + (again 0 previous' current' limit')) + (again (++ offset) previous current limit))) (format previous current)))) (exception: .public (dangling_escape [text Text]) @@ -208,7 +208,7 @@ (^template [<sigil> <un_escaped>] [(^ (static <sigil>)) (let [[previous' current' limit'] (..ascii_un_escaped <un_escaped> offset previous current limit)] - (recur 0 previous' current' limit'))]) + (again 0 previous' current' limit'))]) ([..\0_sigil //.\0] [..\a_sigil //.\a] [..\b_sigil //.\b] @@ -225,7 +225,7 @@ (if (n.< limit @unicode) (do try.monad [[previous' current' limit'] (..unicode_un_escaped offset previous current limit)] - (recur 0 previous' current' limit')) + (again 0 previous' current' limit')) (exception.except ..invalid_unicode_escape [text offset]))) invalid_sigil @@ -233,7 +233,7 @@ (exception.except ..dangling_escape [text]))) _ - (recur (++ offset) previous current limit)) + (again (++ offset) previous current limit)) {try.#Success (case previous "" current _ (format previous current))}))) diff --git a/stdlib/source/library/lux/data/text/unicode/set.lux b/stdlib/source/library/lux/data/text/unicode/set.lux index b7f6720b8..6adc2b4b2 100644 --- a/stdlib/source/library/lux/data/text/unicode/set.lux +++ b/stdlib/source/library/lux/data/text/unicode/set.lux @@ -221,8 +221,8 @@ true {0 #1 left right} - (or (recur left) - (recur right))) + (or (again left) + (again right))) false))) (implementation: .public equivalence |