envzn
0.8 · beta · not released

Library / System / Runtime / Identity

STRUCT

Identity

Field order is load-bearing: it is the synthesized-constructor argument order the IDENTITY lowering emits.

Fields 19

String name

Bare head of the type name — "Person", "Array", "int32".

String home

Declaring module; primitives report "ENVZN".

String fullname

Fully-parameterized spelling, module-qualified unless primitive — "ENVZN::Array[surface::Person]", "int32".

String type

The subject's type, fully qualified unless primitive — "int32", "ENVZN::String", "surface::Person", "ENVZN::Array[surface::Person]".

String modifier

The binding's declared qualifier — constant / mutable / reference / mutable reference / shared mutable reference; blank for a type subject.

String kind

The type kind — Primitive / Enum / Group / Struct / Class / Value Class / Hidden Class / Shared Class / Abstract Class / Interface / View Class.

boolean generic

True when the type has type-parameters (Array[T], Comparable[T]).

boolean internal

True when the type is declared INTERNAL (module-private, §17).

String currentLens

The subject's static/declared type when viewed through an ancestor lens (differs from the concrete type); blank otherwise.

String[] lenses

Ancestors in order: classes -> abstract classes, then implemented interfaces.

boolean blittable

True when a flat byte-copy DUPLICATES the value — both copies then live, both destroyed (C++ trivially-copyable). FALSE for anything owning a heap buffer or handle: String, ByteBuffer, every container.

boolean relocatable

True when a flat byte-copy MOVES the value — the source is abandoned with NO destructor run, so only one copy is ever live (trivially-relocatable). The WEAKER and far more common property: an owning handle is not `blittable` (two owners would double-free) but IS `relocatable`, which is why a growing container may memcpy its slots yet must clone() when copied. The one shape that is neither is a SELF-REFERENTIAL value — the value-array `T[N+]`, whose backing points into its own inline buffer, so byte-moving it would dangle: DynamicString, DynamicByteBuffer.

EnumKind[] cases

For an ENUM type subject: one EnumKind (name + value) per case, in declaration order — the enum's "instances". Empty for every non-enum subject. The generic name<->value logic over this table lives in EnumReflection (EnumReflection.ev).

int32 numberOfDataFields

The number of data fields (== dataFields.length); 0 for a primitive, enum, group or interface.

IdentityField[] dataFields

A class's, value class's or struct's data fields, inherited ones first.

int32 numberOfMethods

The number of methods (== methods.length); 0 for a primitive, enum or group.

IdentityMethod[] methods

A class's, value class's, struct's or interface's methods, inherited ones first; an overridden ancestor method appears once, as the override.

binary[] fieldNameBytes

The data-field names as UTF-8, back to back in `dataFields` order — the bytes a byte-level reader (a JSON key) is compared against, encoded once at compile time instead of from each name's code points on every compare.

int64[] fieldNameStarts

Where each name starts in `fieldNameBytes`, plus one final entry, the total: field k's name is `fieldNameBytes[fieldNameStarts[k], fieldNameStarts[k + 1])`. Empty when there are no data fields.