Extensible pattern matching causes problems: avoid it here
This commit is contained in:
parent
799a8dad4b
commit
946cffd10b
|
@ -384,11 +384,11 @@ directory using the environment given.
|
|||
```
|
||||
|
||||
<span id="example-4">**Example 4.**</span> The final example executes a script in response to
|
||||
an `exec` record being sent as a message to `$config`. The use of `??` indicates a
|
||||
an `exec/restart` record being sent as a message to `$config`. The use of `??` indicates a
|
||||
message-event-handler, rather than `?`, which would indicate an assertion-event-handler.
|
||||
|
||||
```preserves
|
||||
?? <exec ?argv ?restartPolicy> [
|
||||
?? <exec/restart ?argv ?restartPolicy> [
|
||||
let ?id = timestamp
|
||||
let ?facet = facet
|
||||
let ?d = <temporary-exec $id $argv>
|
||||
|
@ -404,8 +404,8 @@ message-event-handler, rather than `?`, which would indicate an assertion-event-
|
|||
```
|
||||
|
||||
First, the current timestamp is bound to `$id`, and a fresh entity representing the facet
|
||||
established in response to the `exec` message is created and bound to `$facet`. The variable
|
||||
`$d` is then initialized to a value uniquely identifying this particular `exec` request. Next,
|
||||
established in response to the `exec/restart` message is created and bound to `$facet`. The variable
|
||||
`$d` is then initialized to a value uniquely identifying this particular `exec/restart` request. Next,
|
||||
`run-service` and `daemon` assertions are placed in `$config`. These assertions communicate
|
||||
with the [built-in program execution and supervision service](./builtin/daemon.md), causing a
|
||||
Unix subprocess to be created to execute the command in `$argv`. Finally, the script responds
|
||||
|
|
|
@ -266,7 +266,7 @@ enabled when they appear and disabled when they disappear:
|
|||
$machine ? <interface ?ifname _ _ _ _ _ _> [
|
||||
$config [
|
||||
! <exec ["ip" "link" "set" $ifname "up"]>
|
||||
?- ! <exec ["ip" "link" "set" $ifname "down"] never>
|
||||
?- ! <exec/restart ["ip" "link" "set" $ifname "down"] never>
|
||||
]
|
||||
]
|
||||
```
|
||||
|
@ -299,7 +299,7 @@ The final pieces of network.pr are static configuration of the loopback interfac
|
|||
<configure-interface "lo" <static "127.0.0.1/8">>
|
||||
? <configure-interface ?ifname <static ?ipaddr>> [
|
||||
! <exec ["ip" "address" "add" "dev" $ifname $ipaddr]>
|
||||
?- ! <exec ["ip" "address" "del" "dev" $ifname $ipaddr] never>
|
||||
?- ! <exec/restart ["ip" "address" "del" "dev" $ifname $ipaddr] never>
|
||||
]
|
||||
```
|
||||
|
||||
|
|
Loading…
Reference in New Issue