You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/specification/3-statements.html
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -35,7 +35,7 @@
35
35
36
36
For `int` and `float` types, a declaration MAY name a specific numeric base by writing `TYPE{base} name`, where `base` is an `int` literal in the range `2` through `64`. A named-base type is a subtype of its parent numeric type: `int{base}` values are `int`s and `float{base}` values are `float`s, but an assignment to a named-base binding requires the value's base to match the declared base. The parent types `int` and `float` (equivalent to `int{0}` and `float{0}`) accept values of any valid numeric base.
37
37
38
-
For `map` types, a declaration MAY specify a schema `map` by writing `map{schema} name`, where `schema` is any expression that evaluates to a `map`. A named-`map` type is a subtype of its parent `map` type: `map{schema}` values are `map`s, but an assignment to a named-`map` binding requires the assigned value to match the schema according to the default key-presence rules of the `MATCH` operator. The parent type `map` accepts any `map` value.
38
+
For `map` types, a declaration MAY specify a schema `map` by writing `map{schema} name`, where `schema` is any expression that evaluates to a `map`. A named-`map` type is a subtype of its parent `map` type: `map{schema}` values are `map`s, but an assignment to a named-`map` binding requires the assigned value to match the schema according to the default key-presence rules of the `VALIDATE` operator. The parent type `map` accepts any `map` value.
39
39
40
40
The first assignment to a symbol MUST use a typed form such as `TYPE name = expression`, `TYPE{base} name = expression`, or `map{schema} name = expression`, with one or more spaces between the type annotation and the name and optional spaces around `=`. Subsequent assignments MAY omit the type annotation, but the symbol's type MUST remain unchanged for the lifetime of that name, including after deletion and re-assignment.
Copy file name to clipboardExpand all lines: docs/specification/4-types.html
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -21,7 +21,7 @@
21
21
22
22
`int` and `float` additionally support named-base variants written `int{base}` and `float{base}`, where `base` is a numeric base in the range `2` through `64` or `0` to denote the parent type. A named-base type and its parent are the same runtime type, but static type checking treats mismatched bases as incompatible. `int` and `float` (base `0`) accept any valid numeric base; `int{base}` and `float{base}` only accept values whose stored base equals the declared base.
23
23
24
-
`map` additionally supports named-schema variants written `map{schema}`, where `schema` is any expression that evaluates to a `map`. A named-schema type and its parent are the same runtime type, but static type checking treats mismatched schemas as incompatible. `map` accepts any `map` value; `map{schema}` only accepts values whose entries satisfy the schema under the default key-presence rules of the `MATCH` operator. Named `map` types with different schemas are treated as distinct types.
24
+
`map` additionally supports named-schema variants written `map{schema}`, where `schema` is any expression that evaluates to a `map`. A named-schema type and its parent are the same runtime type, but static type checking treats mismatched schemas as incompatible. `map` accepts any `map` value; `map{schema}` only accepts values whose entries satisfy the schema under the default key-presence rules of the `VALIDATE` operator. Named `map` types with different schemas are treated as distinct types.
Copy file name to clipboardExpand all lines: docs/specification/9-built-ins.html
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -167,7 +167,7 @@
167
167
168
168
- `boolKEYIN(int|float|strkey,mapmap)` and `boolVALUEIN(ANYvalue,mapmap)` = MUST return `true` when the given key or value occurs in `map` and `false` otherwise.
169
169
170
-
- `boolMATCH(mapmap,mapschema,inttyping=0,intrecurse=0,intshape=0)` = MUST return `true` if every key in `schema` is present in `map` and, when `typing`, `shape`, or `recurse` is nonzero, the corresponding matched values also satisfy type, shape, and recursive nesting constraints. If `schema` contains a key `"match"` whose value is a `map`, that entry is metadata and is not itself required in `map`: the effective value of each parameter is the explicit keyword argument if supplied, otherwise the metadata subkey if present and valid, otherwise the implicit default `0`. Each metadata key MUST be an `int`, and an invalid `"match"` entry, unknown metadata subkey name, or metadata subkey value that is not `int` MUST cause `MATCH` to return `false` rather than raising an error. A non-`map` `"match"` value is matched as an ordinary key.
170
+
- `boolVALIDATE(mapmap,mapschema,inttyping=0,intrecurse=0,intshape=0)` = MUST return `true` if every key in `schema` is present in `map` and, when `typing`, `shape`, or `recurse` is nonzero, the corresponding matched values also satisfy type, shape, and recursive nesting constraints. If `schema` contains a key `"validate"` whose value is a `map`, that entry is metadata and is not itself required in `map`: the effective value of each parameter is the explicit keyword argument if supplied, otherwise the metadata subkey if present and valid, otherwise the implicit default `0`. Each metadata key MUST be an `int`, and an invalid `"validate"` entry, unknown metadata subkey name, or metadata subkey value that is not `int` MUST cause `VALIDATE` to return `false` rather than raising an error. A non-`map` `"validate"` value is matched as an ordinary key.
171
171
172
172
- `mapINV(mapmap)` = MUST return a new map whose keys and values are reversed. Every value in `map` MUST be a scalar key type (`int`, `float`, or `str`), and duplicate values MUST raise a runtime error.
0 commit comments