pub enum Val {
Constr(Name, Vec<Val>),
Tuple(Vec<Val>),
Vec(Vec<Val>),
Struct(Name, Vec<(Name, Val)>),
Art(Loc, ArtContent),
Name(Name),
Const(Const),
ValTODO,
}
Expand description
Reflected value; Gives a syntax for inductive data type
constructors (Constr
), named articulations (Art
) and primitive
data (Data
). All values in the engine (including the values of
nodes, and the values stored on edges) are represented with this
reflected Val
type. Primarily, this distinction between actual
Rust values and this type is what makes the DCG engine “reflected”
by the definitions in this module, and not identical to them.
Variants§
Constr(Name, Vec<Val>)
Constructor, with a sequence of value parameters.
Tuple(Vec<Val>)
A tuple of values (like a constructor, but without a constructor
name). Can be seen as a special case of Constr
.
Vec(Vec<Val>)
A list of values (like a tuple, but parsed and printed
differently). Can be seen as a special case of Constr
.
Struct(Name, Vec<(Name, Val)>)
Constructor with a sequence of fields (name-value pairs) as parameters.
Art(Loc, ArtContent)
Named articulation, and its content (an Art
is either a named value, or a named computation).
Name(Name)
First-class Name
value.
Const(Const)
Primitive, immutable data.
ValTODO
Temporary; for marking places in code where we should produce a value, but don’t yet have a good way to do so.