Specify extensibility.
This commit is contained in:
parent
3e67c75427
commit
c986ca76cf
|
@ -4,7 +4,7 @@ title: "Preserves Schema"
|
||||||
---
|
---
|
||||||
|
|
||||||
Tony Garnock-Jones <tonyg@leastfixedpoint.com>
|
Tony Garnock-Jones <tonyg@leastfixedpoint.com>
|
||||||
December 2023. Version 0.3.5.
|
April 2024. Version 0.4.
|
||||||
|
|
||||||
[abnf]: https://tools.ietf.org/html/rfc7405
|
[abnf]: https://tools.ietf.org/html/rfc7405
|
||||||
[identifierlike]: #sufficiently-identifierlike-values
|
[identifierlike]: #sufficiently-identifierlike-values
|
||||||
|
@ -415,6 +415,8 @@ entry.
|
||||||
|
|
||||||
DictionaryPattern = "{" *(value ":" NamedSimplePattern) "}"
|
DictionaryPattern = "{" *(value ":" NamedSimplePattern) "}"
|
||||||
|
|
||||||
|
**Extensibility.** All of these compound patterns allow for extensibility in that they allow additional fields, elements, or dictionary entries, respectively. For example, the pattern `<a @value int>` will match not only `<a 123>` but also `<a 123 "hello">`, while rejecting `<a>` or `<a [x y z]>`. Similarly, `{a: int, b: int}` matches `{a: 123, b: 234, c: [x y z]}` as well as `{a: 123, b: 234}`. Each compound pattern places constraints only on the *mentioned* elements of a datum, namely the leftmost fields of a record, the leftmost elements of a tuple, and the mentioned keys of a dictionary. Unmentioned elements are free to be present or absent.
|
||||||
|
|
||||||
### Identifiers and Bindings: NamedPattern and NamedSimplePattern
|
### Identifiers and Bindings: NamedPattern and NamedSimplePattern
|
||||||
|
|
||||||
Compound patterns specifications contain `NamedPattern`s or
|
Compound patterns specifications contain `NamedPattern`s or
|
||||||
|
|
Loading…
Reference in New Issue