pub enum FieldValue {
FvBool { v: boolean },
FvInt { v: integer },
FvLong { v: integer },
FvFloat { v: float },
FvSingle { v: single },
FvChar { v: character },
FvText { v: text },
}
Wraps a field value in a type-discriminated enum for compile-time field iteration.
pub struct StructField {
pub name: text,
pub value: FieldValue,
// Was the field DECLARED nullable (`text?` rather than `text`)?
//
// The payload variants above are typed non-null, and `τ?` shares `τ`'s
// runtime layout — a nullable field spells absence with a SENTINEL
// rather than a wrapper. So a null field's value arrives inside `FvText` /
// `FvInt` / … as that sentinel, and this flag is what says so; without it a
// reader would have to discover the possibility by being surprised.
//
// Mirrors `FieldInfo.nullable` from `type_of` (07_reflect.loft) on purpose:
// the two field lists describe the same declaration and must agree.
pub nullable: boolean,
}
Represents a single struct field during compile-time iteration.
pub operator to_text(self: integer) -> text
Converts an integer to its decimal text. Built-in types define to_text so they satisfy the Printable interface (used by print, format strings, …).