Tweak: execution instead of evaluation
This commit is contained in:
parent
f11cacf513
commit
808b991a35
|
@ -120,7 +120,7 @@ the contents of a variable, use the `+=` form of *AssertionInstruction*.
|
||||||
`<`*ValueExpr*` `*ValueExpr*...`>` |
|
`<`*ValueExpr*` `*ValueExpr*...`>` |
|
||||||
`{`*ValueExpr*`:`*ValueExpr*` `...`}`
|
`{`*ValueExpr*`:`*ValueExpr*` `...`}`
|
||||||
|
|
||||||
The most general form of *AssertionInstruction* is "`+= `*ValueExpr*". When evaluated, the
|
The most general form of *AssertionInstruction* is "`+= `*ValueExpr*". When executed, the
|
||||||
result of evaluating *ValueExpr* will be published (asserted) at the entity denoted by the
|
result of evaluating *ValueExpr* will be published (asserted) at the entity denoted by the
|
||||||
active target register.
|
active target register.
|
||||||
|
|
||||||
|
@ -131,7 +131,7 @@ As a convenient shorthand, the compiler also interprets every Preserves record o
|
||||||
|
|
||||||
*SendInstruction* = `! `*ValueExpr*
|
*SendInstruction* = `! `*ValueExpr*
|
||||||
|
|
||||||
When evaluated, the result of evaluating *ValueExpr* will be sent as a message to the entity
|
When executed, the result of evaluating *ValueExpr* will be sent as a message to the entity
|
||||||
denoted by the active target register.
|
denoted by the active target register.
|
||||||
|
|
||||||
### Reacting to events
|
### Reacting to events
|
||||||
|
@ -183,10 +183,10 @@ facet terminates, *Instruction* is run.
|
||||||
*ValueExpr*
|
*ValueExpr*
|
||||||
|
|
||||||
Values can be destructured and new variables introduced into the environment with `let`, which
|
Values can be destructured and new variables introduced into the environment with `let`, which
|
||||||
is a "destructuring bind" or "pattern-match definition" statement. When evaluated, the result
|
is a "destructuring bind" or "pattern-match definition" statement. When executed, the result of
|
||||||
of evaluating *ConvenienceExpr* is matched against the result of evaluating *PatternExpr*. If
|
evaluating *ConvenienceExpr* is matched against the result of evaluating *PatternExpr*. If the
|
||||||
the match fails, the actor crashes. If the match succeeds, the resulting binding variables (if
|
match fails, the actor crashes. If the match succeeds, the resulting binding variables (if any)
|
||||||
any) are introduced into the environment.
|
are introduced into the environment.
|
||||||
|
|
||||||
The right-hand-side of a `let`, after the equals sign, is either a normal *ValueExpr* or one of
|
The right-hand-side of a `let`, after the equals sign, is either a normal *ValueExpr* or one of
|
||||||
the following special "convenience" expressions:
|
the following special "convenience" expressions:
|
||||||
|
@ -200,15 +200,15 @@ the following special "convenience" expressions:
|
||||||
`stop` to the entity (using e.g. the *SendInstruction* "`! stop`") triggers termination of
|
`stop` to the entity (using e.g. the *SendInstruction* "`! stop`") triggers termination of
|
||||||
its associated facet. The entity does not respond to any other assertion or message.
|
its associated facet. The entity does not respond to any other assertion or message.
|
||||||
|
|
||||||
### Conditional evaluation
|
### Conditional execution
|
||||||
|
|
||||||
*ConditionalInstruction* = `$`*var*` =~ `*PatternExpr*` `*Instruction*` `*Instruction* ...
|
*ConditionalInstruction* = `$`*var*` =~ `*PatternExpr*` `*Instruction*` `*Instruction* ...
|
||||||
|
|
||||||
When evaluated, the value in variable *var* is matched against the result of evaluating
|
When executed, the value in variable *var* is matched against the result of evaluating
|
||||||
*PatternExpr*.
|
*PatternExpr*.
|
||||||
|
|
||||||
- If the match succeeds, the resulting bound variables are placed in the environment and
|
- If the match succeeds, the resulting bound variables are placed in the environment and
|
||||||
evaluation continues with the first *Instruction*. The subsequent *Instruction*s are not
|
execution continues with the first *Instruction*. The subsequent *Instruction*s are not
|
||||||
executed in this case.
|
executed in this case.
|
||||||
|
|
||||||
- If the match fails, then the first *Instruction* is skipped, and the subsequent
|
- If the match fails, then the first *Instruction* is skipped, and the subsequent
|
||||||
|
|
Loading…
Reference in New Issue