diff options
| author | Marshall Lochbaum <mwlochbaum@gmail.com> | 2020-07-28 15:55:50 -0400 |
|---|---|---|
| committer | Marshall Lochbaum <mwlochbaum@gmail.com> | 2020-07-28 16:29:50 -0400 |
| commit | 3fd2b860b26878470011fc18cb8351867a5d7639 (patch) | |
| tree | 9b60b59fcea66dc32267eeb3fda86211c5ea35ee /spec/evaluate.md | |
| parent | 4a3fdd8225e90abb703a0e1cd1f89ff6aa7b7538 (diff) | |
Specify variable scoping
Diffstat (limited to 'spec/evaluate.md')
| -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 a21dc5fa..575558ff 100644 --- a/spec/evaluate.md +++ b/spec/evaluate.md @@ -22,7 +22,7 @@ If there is no left argument, but the `BODY` contains `𝕨` at the top level, t ### Assignment -An *assignment* is one of the four rules containing `ASGN`. It is evaluated by first evaluating the right-hand-side `subExpr`, `FuncExpr`, `_m1Expr`, or `_m2Exp_` expression, and then storing the result in the left-hand-side identifier or identifiers. The result of the assignment expression is the result of its right-hand side. Except for subjects, only a lone identifier is allowed on the left-hand side and storage is obvious. For subjects, *multiple assignment* with a list left-hand side is also allowed. Multiple assignment is performed recursively by assigning right-hand-side values to the left-hand-side targets, with single-identifier (`s`) assignment as the base case. When matching the right-hand side to a list left-hand side, the left hand side is treated as a list of `lhs` targets. The evaluated right-hand side must be a list (rank-1 array) of the same length, and is matched to these targets element-wise. +An *assignment* is one of the four rules containing `ASGN`. It is evaluated by first evaluating the right-hand-side `subExpr`, `FuncExpr`, `_m1Expr`, or `_m2Exp_` expression, and then storing the result in the left-hand-side identifier or identifiers. The result of the assignment expression is the result of its right-hand side. Except for subjects, only a lone identifier is allowed on the left-hand side and storage sets it equal to the result. For subjects, *multiple assignment* with a list left-hand side is also allowed. Multiple assignment is performed recursively by assigning right-hand-side values to the left-hand-side targets, with single-identifier (`s`) assignment as the base case. When matching the right-hand side to a list left-hand side, the left hand side is treated as a list of `lhs` targets. The evaluated right-hand side must be a list (rank-1 array) of the same length, and is matched to these targets element-wise. *Modified assignment* is the subject assignment rule `lhs Derv "↩" subExpr`. In this case, `lhs` should be evaluated as if it were a `subExpr` (the syntax is a subset of `subExpr`), and the result of the function application `lhs Derv subExpr` should be assigned to `lhs`, and is also the result of the modified assignment expression. |
