Update for Preserves 0.991
This commit is contained in:
parent
9d53a1622b
commit
a874fc9aa8
|
@ -43,10 +43,10 @@ manifests as the need for *some non-comment following every comment*. In scripts
|
|||
date, often an empty *SequencingInstruction* serves to anchor comments at the end of a file:
|
||||
|
||||
```preserves
|
||||
; A comment
|
||||
; Another comment
|
||||
; The following empty sequence is needed to give the comments
|
||||
; something to attach to
|
||||
# A comment
|
||||
# Another comment
|
||||
# The following empty sequence is needed to give the comments
|
||||
# something to attach to
|
||||
[]
|
||||
```
|
||||
|
||||
|
@ -456,15 +456,15 @@ it, and then passing it to somewhere else is a useful trick for creating scripte
|
|||
to respond to a few different kinds of assertion or message:
|
||||
|
||||
```preserves
|
||||
let ?ds = dataspace ; create the dataspace
|
||||
let ?ds = dataspace # create the dataspace
|
||||
|
||||
$config += <my-entity $ds> ; send it to peers for them to use
|
||||
$config += <my-entity $ds> # send it to peers for them to use
|
||||
|
||||
$ds [ ; select $ds as the active target for `DuringInstruction`s inside the [...]
|
||||
? pat1 [ ... ] ; respond to assertions of the form `pat1`
|
||||
? pat2 [ ... ] ; respond to assertions of the form `pat2`
|
||||
?? pat3 [ ... ] ; respond to messages of the form `pat3`
|
||||
?? pat4 [ ... ] ; respond to messages of the form `pat4`
|
||||
$ds [ # select $ds as the active target for `DuringInstruction`s inside the [...]
|
||||
? pat1 [ ... ] # respond to assertions of the form `pat1`
|
||||
? pat2 [ ... ] # respond to assertions of the form `pat2`
|
||||
?? pat3 [ ... ] # respond to messages of the form `pat3`
|
||||
?? pat4 [ ... ] # respond to messages of the form `pat4`
|
||||
]
|
||||
```
|
||||
|
||||
|
|
|
@ -30,16 +30,16 @@ and will yield an empty result set when applied to any other kind of input.
|
|||
|
||||
```preserves-schema
|
||||
Axis =
|
||||
/ <values> ;; yields the immediate subvalues of the input nonrecursively
|
||||
/ <descendants> ;; recurses through all descendant subvalues of the input
|
||||
/ <at @key any> ;; extracts a subvalue named by the given key, if any
|
||||
/ <label> ;; extracts a Record's label, if any
|
||||
/ <keys> ;; extracts all keys (for subvalues) of the input, nonrecursively
|
||||
/ <length> ;; extracts the length/size of the input, if any
|
||||
/ <annotations> ;; extracts all annotations attached to the input
|
||||
/ <embedded> ;; moves into the representation of an embedded value, if any
|
||||
/ <parse @module [symbol ...] @name symbol> ;; parses using Preserves Schema
|
||||
/ <unparse @module [symbol ...] @name symbol> ;; unparses using Preserves Schema
|
||||
/ <values> # yields the immediate subvalues of the input nonrecursively
|
||||
/ <descendants> # recurses through all descendant subvalues of the input
|
||||
/ <at @key any> # extracts a subvalue named by the given key, if any
|
||||
/ <label> # extracts a Record's label, if any
|
||||
/ <keys> # extracts all keys (for subvalues) of the input, nonrecursively
|
||||
/ <length> # extracts the length/size of the input, if any
|
||||
/ <annotations> # extracts all annotations attached to the input
|
||||
/ <embedded> # moves into the representation of an embedded value, if any
|
||||
/ <parse @module [symbol ...] @name symbol> # parses using Preserves Schema
|
||||
/ <unparse @module [symbol ...] @name symbol> # unparses using Preserves Schema
|
||||
.
|
||||
```
|
||||
|
||||
|
@ -56,13 +56,13 @@ emitting it unchanged (with exceptions, detailed below) or emitting no outputs a
|
|||
|
||||
```preserves-schema
|
||||
Filter =
|
||||
/ <nop> ;; Always emit the input
|
||||
/ <compare @op Comparison @literal any> ;; Emit iff the comparison holds
|
||||
/ <regex @regex string> ;; Emit iff input is String and regex matches
|
||||
/ <test @pred Predicate> ;; Apply complex predicate
|
||||
/ <real> ;; Emit iff input is Float, Double, or Integer
|
||||
/ <int> ;; TRUNCATE and emit iff Float, Double or Integer
|
||||
/ <kind @kind ValueKind> ;; Emit iff input kind matches
|
||||
/ <nop> # Always emit the input
|
||||
/ <compare @op Comparison @literal any> # Emit iff the comparison holds
|
||||
/ <regex @regex string> # Emit iff input is String and regex matches
|
||||
/ <test @pred Predicate> # Apply complex predicate
|
||||
/ <real> # Emit iff input is Float, Double, or Integer
|
||||
/ <int> # TRUNCATE and emit iff Float, Double or Integer
|
||||
/ <kind @kind ValueKind> # Emit iff input kind matches
|
||||
.
|
||||
```
|
||||
|
||||
|
|
|
@ -101,7 +101,7 @@ InternalProtocol = any .
|
|||
```
|
||||
ModemPacket = @in <from-modem @packet any> / @out <to-modem @packet any> .
|
||||
|
||||
; The bodies are instances of SamsungFmtMessage and SamsungRfsMessage, respectively.
|
||||
# The bodies are instances of SamsungFmtMessage and SamsungRfsMessage, respectively.
|
||||
FmtPacket = <fmt @body #!any> .
|
||||
RfsPacket = <rfs @body #!any> .
|
||||
```
|
||||
|
@ -111,8 +111,8 @@ RfsPacket = <rfs @body #!any> .
|
|||
Analogous to AT command execution for Hayes-style modems.
|
||||
|
||||
```
|
||||
; Assertion. Asks the modem to execute the given command.
|
||||
# Assertion. Asks the modem to execute the given command.
|
||||
CommandRPC = <execute-command @command FmtPacket @replyTo #!FmtPacket> .
|
||||
; Message. Asks the modem to execute the given command, but not to send back the reply.
|
||||
# Message. Asks the modem to execute the given command, but not to send back the reply.
|
||||
CommandEvent = <execute-command @command FmtPacket> .
|
||||
```
|
||||
|
|
|
@ -40,11 +40,11 @@ heuristics.
|
|||
|
||||
```
|
||||
InterfaceType =
|
||||
/ ; `lo` and friends
|
||||
/ # `lo` and friends
|
||||
=loopback
|
||||
/ ; `eth0`, bridges, anything that isn't loopback and isn't wireless
|
||||
/ # `eth0`, bridges, anything that isn't loopback and isn't wireless
|
||||
=normal
|
||||
/ ; 'wlan0' and friends
|
||||
/ # 'wlan0' and friends
|
||||
=wireless
|
||||
.
|
||||
```
|
||||
|
@ -155,11 +155,11 @@ MobileDataEnabled = <mobile-data-enabled> .
|
|||
|
||||
```
|
||||
WifiAuthentication =
|
||||
/ ; No authentication necessary: open network
|
||||
/ # No authentication necessary: open network
|
||||
=open
|
||||
/ ; Pre-shared key (WPA2-PSK etc)
|
||||
/ # Pre-shared key (WPA2-PSK etc)
|
||||
<psk @password string>
|
||||
/ ; Other, not-yet-implemented
|
||||
/ # Other, not-yet-implemented
|
||||
@other any
|
||||
.
|
||||
```
|
||||
|
|
|
@ -63,7 +63,7 @@ the user chooses to answer, an `AnswerCall` message tells the modem to do the ne
|
|||
`callId` is the same value as in the `ActiveCall` assertion.
|
||||
|
||||
```
|
||||
; Message. Triggers call answering.
|
||||
# Message. Triggers call answering.
|
||||
AnswerCall = <answer-call @callId int> .
|
||||
```
|
||||
|
||||
|
@ -97,7 +97,7 @@ should match a `ModemPresent` assertion) to place an outbound call to the named
|
|||
number).
|
||||
|
||||
```
|
||||
; Message. Starts an outgoing call.
|
||||
# Message. Starts an outgoing call.
|
||||
PlaceCall = <place-call @devicePath string @peer Address> .
|
||||
```
|
||||
|
||||
|
@ -145,7 +145,7 @@ field should be a reference to an entity that expects the `ok` symbol as a messa
|
|||
transmission has been processed by the modem.
|
||||
|
||||
```
|
||||
; Assertion. An outgoing SMS should be transmitted.
|
||||
# Assertion. An outgoing SMS should be transmitted.
|
||||
SmsTransmission = <sms-transmission @smsc Address @peer Address @body string @continuation #!=ok > .
|
||||
```
|
||||
|
||||
|
|
Loading…
Reference in New Issue