diff options
| author | Marshall Lochbaum <mwlochbaum@gmail.com> | 2021-11-27 21:48:20 -0500 |
|---|---|---|
| committer | Marshall Lochbaum <mwlochbaum@gmail.com> | 2021-11-27 21:48:20 -0500 |
| commit | 03dc07bf986051308342e7182fdb745f669f5bd2 (patch) | |
| tree | 2325632600574da2d9a946102d12c59f079bbca9 /spec/grammar.md | |
| parent | 91a329eeb75519795137b48fa1d3df64a82db980 (diff) | |
Specify predicates
Diffstat (limited to 'spec/grammar.md')
| -rw-r--r-- | spec/grammar.md | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/spec/grammar.md b/spec/grammar.md index 92d26c1a..8c394579 100644 --- a/spec/grammar.md +++ b/spec/grammar.md @@ -90,9 +90,9 @@ Additionally, an inference header doesn't affect evaluation of the function, but | headW ( F | "𝕊" ) "˜" "⁼" headX | ( F | "𝕊" ) "˜"? "⁼" -A braced block contains bodies, which are lists of statements, separated by semicolons and possibly preceded by headers, which are separated from the body with a colon. Multiple bodies allow different handling for various cases, which are pattern-matched by headers. For an immediate block there are no inputs, so there can only be one possible case and one body. Functions and modifiers allow any number of "matched" bodies, with headers that have arguments, followed by at most two "main" bodies with either no headers or headers without arguments. If there is one main body, it is ambivalent, but two main bodies refer to the monadic and dyadic cases. +A braced block contains bodies, which are lists of statements, separated by semicolons and possibly preceded by headers, which are separated from the body with a colon. A non-final expression can be made into a predicate by following it with the separator-like `?`. Multiple bodies allow different handling for various cases, which are pattern-matched by headers. For an immediate block there are no inputs, so there can only be one possible case and one body. Functions and modifiers allow any number of "matched" bodies, with headers that have arguments, followed by at most two "main" bodies with either no headers or headers without arguments. If there is one main body, it is ambivalent, but two main bodies refer to the monadic and dyadic cases. - BODY = PROGRAM + BODY = ⋄? ( STMT ⋄ | EXPR ⋄? "?" ⋄? )* STMT ⋄? FCase = ⋄? FuncHead ":" BODY _mCase = ⋄? _m1Head ":" BODY _cCase_ = ⋄? _m2Head_ ":" BODY |
