diff options
| author | Marshall Lochbaum <mwlochbaum@gmail.com> | 2021-06-19 22:00:51 -0400 |
|---|---|---|
| committer | Marshall Lochbaum <mwlochbaum@gmail.com> | 2021-06-19 22:02:14 -0400 |
| commit | ab74b5cee5260544dd651b7edc22ad8b3554cdde (patch) | |
| tree | 26e9bd4d77a2e34256c9b7e30772184856d29894 /spec | |
| parent | de0a7a3d73ea026c9f483aadd7647f19e8932f42 (diff) | |
Clarify valid uses of 饾晭 as Nothing
Diffstat (limited to 'spec')
| -rw-r--r-- | spec/evaluate.md | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/spec/evaluate.md b/spec/evaluate.md index 0ad6bf10..90ed32a9 100644 --- a/spec/evaluate.md +++ b/spec/evaluate.md @@ -20,7 +20,7 @@ To evaluate a block when enough inputs have been received, first the correct cas The only remaining step before evaluating the `BODY` is to bind the inputs and other names. Special names are always bound when applicable: `饾暔饾暕饾暏` if arguments are used, `饾暔` if there is a left argument, `饾晽饾晿` if operands are used, and `_饾暎` and `_饾暎_` for modifiers and combinators, respectively. Any names in the header are also bound, allowing multiple assignment for arguments. -If there is no left argument, but the `BODY` contains `饾暔` at the top level, then it is conceptually re-parsed with `饾暔` replaced by `路` to give a monadic version before application; this modifies the syntax tree by replacing some instances of `arg` with `nothing`. However, it also causes an error if, in a function that is called with no left argument, `饾暔` is used as an operand or list element, where `nothing` is not allowed by the grammar. The same effect can also be achieved dynamically by treating `路` as a value and checking for it during execution. If it is used as a left argument, then the function should instead be called with no left argument (and similarly in trains); it it is used as a right argument, then the function and its left argument are evaluated but rather than calling the function `路` is "returned" immediately; and if it is used in another context then it causes an error. +If there is no left argument, but the `BODY` contains `饾暔` or `饾晭` at the top level, then it is conceptually re-parsed with `饾暔` replaced by `路` to give a monadic version before application; this modifies the syntax tree by replacing some instances of `arg` with `nothing`. However, it also causes an error if, in a function that is called with no left argument, `饾暔` is used as an operand or list element, where `nothing` is not allowed by the grammar. In the case of `饾晭` it's almost always an error, only valid if used alone in a statement or as the left part of a `Fork`. True re-parsing is not required as the same effect can also be achieved dynamically by treating `路` as a value and checking for it during execution. If it's used as a left argument, then the function should instead be called with no left argument (and similarly in trains); if it's used as a right argument, then the function and its left argument are evaluated but rather than calling the function `路` is "returned" immediately; and if it's used in another context then it causes an error. ### Assignment |
