diff options
author | Eduardo Julian | 2018-07-21 23:57:21 -0400 |
---|---|---|
committer | Eduardo Julian | 2018-07-21 23:57:21 -0400 |
commit | 9671d6064dd02dfe6c32492f5b9907b096e5bd89 (patch) | |
tree | db89e3908dedd606ce5838096bc5df9ebcc9b1c4 /stdlib/source/lux/control | |
parent | 22d10692d87ac1c07fc14f6100917b913bb0f8b3 (diff) |
Re-named "seq" to "and" and "alt" to "or".
Diffstat (limited to 'stdlib/source/lux/control')
-rw-r--r-- | stdlib/source/lux/control/concatenative.lux | 6 | ||||
-rw-r--r-- | stdlib/source/lux/control/exception.lux | 6 | ||||
-rw-r--r-- | stdlib/source/lux/control/monad/indexed.lux | 8 | ||||
-rw-r--r-- | stdlib/source/lux/control/parser.lux | 8 | ||||
-rw-r--r-- | stdlib/source/lux/control/pipe.lux | 4 |
5 files changed, 16 insertions, 16 deletions
diff --git a/stdlib/source/lux/control/concatenative.lux b/stdlib/source/lux/control/concatenative.lux index ab3ee39b1..ee4a78e13 100644 --- a/stdlib/source/lux/control/concatenative.lux +++ b/stdlib/source/lux/control/concatenative.lux @@ -31,7 +31,7 @@ (def: aliases^ (s.Syntax (List Alias)) - (|> (p.seq s.local-identifier s.any) + (|> (p.and s.local-identifier s.any) p.some s.record (p.default (list)))) @@ -42,9 +42,9 @@ (def: stack^ (s.Syntax Stack) - (p.either (p.seq (p.maybe bottom^) + (p.either (p.and (p.maybe bottom^) (s.tuple (p.some s.any))) - (p.seq (|> bottom^ (parser/map (|>> #.Some))) + (p.and (|> bottom^ (parser/map (|>> #.Some))) (parser/wrap (list))))) (def: (stack-fold tops bottom) diff --git a/stdlib/source/lux/control/exception.lux b/stdlib/source/lux/control/exception.lux index 86c2a8ddb..2a3cd92c0 100644 --- a/stdlib/source/lux/control/exception.lux +++ b/stdlib/source/lux/control/exception.lux @@ -84,8 +84,8 @@ (syntax: #export (exception: {export csr.export} {t-vars (p.default (list) csr.type-variables)} - {[name inputs] (p.either (p.seq s.local-identifier (wrap (list))) - (s.form (p.seq s.local-identifier (p.some csr.typed-input))))} + {[name inputs] (p.either (p.and s.local-identifier (wrap (list))) + (s.form (p.and s.local-identifier (p.some csr.typed-input))))} {body (p.maybe s.any)}) {#.doc (doc "Define a new exception type." "It moslty just serves as a way to tag error messages for later catching." @@ -126,7 +126,7 @@ ($_ text/compose padding header ": " message "\n")))) (text.join-with "")))) -(syntax: #export (report {entries (p.many (s.tuple (p.seq s.any s.any)))}) +(syntax: #export (report {entries (p.many (s.tuple (p.and s.any s.any)))}) (wrap (list (` (report' (list (~+ (|> entries (list/map (function (_ [header message]) (` [(~ header) (~ message)]))))))))))) diff --git a/stdlib/source/lux/control/monad/indexed.lux b/stdlib/source/lux/control/monad/indexed.lux index af83464d4..ef2acb904 100644 --- a/stdlib/source/lux/control/monad/indexed.lux +++ b/stdlib/source/lux/control/monad/indexed.lux @@ -24,7 +24,7 @@ (def: binding (Syntax Binding) - (p.seq s.any s.any)) + (p.and s.any s.any)) (type: Context (#Let (List Binding)) @@ -32,9 +32,9 @@ (def: context (Syntax Context) - (p.alt (p.after (s.this (' #let)) - (s.tuple (p.some binding))) - binding)) + (p.or (p.after (s.this (' #let)) + (s.tuple (p.some binding))) + binding)) (def: (pair-list [binding value]) (All [a] (-> [a a] (List a))) diff --git a/stdlib/source/lux/control/parser.lux b/stdlib/source/lux/control/parser.lux index 2f25d13da..32ef09784 100644 --- a/stdlib/source/lux/control/parser.lux +++ b/stdlib/source/lux/control/parser.lux @@ -1,5 +1,5 @@ (.module: - [lux (#- not) + [lux (#- or and not) [control [functor (#+ Functor)] [apply (#+ Apply)] @@ -104,7 +104,7 @@ xs (some p)] (wrap (list& x xs)))) -(def: #export (seq p1 p2) +(def: #export (and p1 p2) {#.doc "Sequencing combinator."} (All [s a b] (-> (Parser s a) (Parser s b) (Parser s [a b]))) @@ -113,7 +113,7 @@ x2 p2] (wrap [x1 x2]))) -(def: #export (alt p1 p2) +(def: #export (or p1 p2) {#.doc "Heterogeneous alternative combinator."} (All [s a b] (-> (Parser s a) (Parser s b) (Parser s (| a b)))) @@ -190,7 +190,7 @@ (#.Some x) (do @ - [xs' (some (seq sep p))] + [xs' (some (..and sep p))] (wrap (#.Cons x (list/map product.right xs')))) ))) diff --git a/stdlib/source/lux/control/pipe.lux b/stdlib/source/lux/control/pipe.lux index a8fefb938..ffdb78575 100644 --- a/stdlib/source/lux/control/pipe.lux +++ b/stdlib/source/lux/control/pipe.lux @@ -45,7 +45,7 @@ prev {else body^} {_ _reverse_} - {branches (p.some (p.seq body^ body^))}) + {branches (p.some (p.and body^ body^))}) {#.doc (doc "Branching for pipes." "Both the tests and the bodies are piped-code, and must be given inside a tuple." (|> 5 @@ -130,7 +130,7 @@ [(~+ (list/map (function (_ body) (` (|> (~ g!temp) (~+ body)))) paths))])))))) -(syntax: #export (case> {branches (p.many (p.seq s.any s.any))} +(syntax: #export (case> {branches (p.many (p.and s.any s.any))} prev) {#.doc (doc "Pattern-matching for pipes." "The bodies of each branch are NOT pipes; just regular values." |