Expand description
Value model, environment, and type resolution — a port of the reference implementation’s semantics.ts.
Structs§
- ArrV
- an array value
- Assert
Item - an assertion or a guarded group of a record type
- Closure
- a function value: its parameters, its body, the scope it closed over
- Const
Entry - a constant’s declaration and memoized value
- Diag
- a diagnostic (§6, §12)
- Diag
Decl - a diagnostic template’s declaration
- Env
- the environment of a module: its declarations, its imports, its roots and diagnostics, the unit space
- EvalErr
- an evaluation error, with its code when it has one
- Export
- an exported name: the environment declaring it
- Func
Entry - a function’s declaration
- MapV
- a map value
- Member
- a member of a resolved record type
- NsRefV
- a namespace’s exports
- PreValV
- an expression waiting to be evaluated in its scope
- RecInst
- a record instance: its type, its path, its slots
- RecType
- a record type’s shape
- Scope
- an evaluation scope: the enclosing instance, the local variables, the root, the module environment
- Slot
- a member’s slot in an instance
- Ty
- a resolved type: its kind, its name when named, its
elsetail - Type
Entry - a type’s declaration
- Unit
Decl - a unit’s declaration
Enums§
- Compute
- how a slot computes its value
- Fail
- why an evaluation stopped
- MKind
- a member’s kind (§5)
- RTk
- the kinds of resolved types (§3)
- Seg
- a segment of a canonical path (§7.2)
- Slot
State - the state of a slot
- Value
- a runtime value (§9): the scalars, quantities, references, and instances, and the engine’s intermediate forms
Functions§
- cmp_
path - Canonical path order (§7.2): segment-wise, indices numerically, names and keys lexicographically, a prefix first.
- compile_
pattern - Compile a pattern body to a regular expression.
- dot_
spellable - dot-spellable (§3.11, §4.3): identifier-shaped and not a literal keyword
- err
- An evaluation error without a code.
- err_
code - An evaluation error with a code.
- is_rec
- Whether the type is a record.
- js_
num_ str - ECMAScript Number::toString for finite doubles (shortest round trip)
- json_
str - A string as JSON text, escaped.
- key_
of_ vec - The dimension’s key (
Length*Time^-1). - parse_
path - A path string from a document:
.nameis a member,["…"]a bracketed segment (a map key, or a member the dot cannot spell — the canonical walk, §7.5, decides which is legal where),[n]an index. - path_
str - A canonical path’s text, relative to
rel_root($.…) when given. - pattern_
error - Why a pattern body is outside the §3.6 core (E4119), when it is.
- read_
json - Read a JSON document (§10.2): objects keep their key order, integers stay exact; trailing characters are an error.
- rec_
members - The members of a record type; empty for any other type.
- rec_
type - An empty record type.
- seg_
text - A segment’s text as the path spells it.
- sort_
diags - §6.7: evaluation- and validation-time diagnostics sort by (path, id), path in canonical order; stable
- subst_
expr - Substitute values for names in an expression.
- subst_
type - Substitute a generic type’s parameters (§3.15).
- ty
- A resolved type of a kind.
- value_
eq - Structural equality of two values (§4.5).
- vec_
combine - Two dimensions multiplied (
sign1) or divided (sign-1). - vec_
of_ key - A dimension from its key.