From 08315d71c8e737694ad21e4d1dd5f1aecbc13560 Mon Sep 17 00:00:00 2001 From: Marshall Lochbaum Date: Mon, 21 Jun 2021 19:03:59 -0400 Subject: =?UTF-8?q?Disallow=20=F0=9D=95=8E=20in=20one-argument=20calls=20e?= =?UTF-8?q?xplicitly?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- spec/evaluate.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'spec') diff --git a/spec/evaluate.md b/spec/evaluate.md index 90ed32a9..9ac91e53 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 `饾暔` 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. +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 `subject`, `arg`, or `Operand` with `nothing`. The token `饾晭` is not allowed in this case and causes an error. Re-parsing `饾暔` can also cause an error if it's used as an operand or list element, where `nothing` is not allowed by the grammar. Note that these errors must not appear if the block is always called with two arguments. 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 -- cgit v1.2.3