envzn
0.8 · beta · not released

Misc

DataValue, the dynamic value behind JSON serialisation, and opaque.

Generated by bin/build_library_doc.py from the kernel sources. Do not edit by hand: change the generator, or the doc comments in kernel/src/, and re-run it.

DataValue

CLASS DataValue

IMPLEMENTS Serializable, Cloneable

The kernel's neutral, format-independent value model — the abstract shape shared by JSON, BSON, CBOR, MessagePack and DB rows — as a whole DOCUMENT in one object (the two-layer cake, ENVZN_USER_GUIDE §2e): a storage layer of primitive arrays, and the public face composed over it. No object per node: no DataValue, String, Dictionary or frame per value. Ported from benchmarks/s09_json/envzn_newJson (serde-explicit-codecs design §6).

Storage: nodes every node, a tagged slot (DataNode, structs.ev); a node is its int64 index items an array's elements, one contiguous run per array keys / vals an object's members, one contiguous run per object: the member's interned key id and its value node bytes every string value, UTF-8, as (offset, length) windows kOff / kLen / the interned keys — each distinct key stored ONCE in kBytes and kHash / found through an open-addressed hash (slots); a member lookup kBytes / slots compares integer ids, not bytes

Face: the reading surface, with the node as an explicit argument — a document cannot hand out handles to itself, so the caller holds the document and passes node indices. root() is where a walk starts (-1 for an empty document).

  • kind(v), isNull(v) … isObject(v) — the node's kind
  • asBool(v), asNumber(v), asString(v) — by value, (T | STATUS)
  • asStringBytes(v) + bytesRef() — the string as a UTF-8 window
  • count(v), element(a, i), lookupReference(o, key) — containers

An object keeps every member in the order it was written, duplicate keys included; lookupReference finds the FIRST. An integer past int64 is its own node kind (JUINT) and reads back as an UNSIGNED number.

Built by DataValueBuilder through the INTERNAL MODIFY methods below (kernel only); read by anyone through the face; walked into any Serializer by serialize(), or pulled from by DataValueReader (a Reconstructor).

kernel/src/DataValue.ev:47

Constructors

INIT()
INIT(int64 sizeHint)

Methods

METHOD clone() RETURNS DataValue
METHOD root() RETURNS int64
METHOD kind(int64 v) RETURNS DataKind
METHOD isNull(int64 v) RETURNS boolean
METHOD isBool(int64 v) RETURNS boolean
METHOD isNumber(int64 v) RETURNS boolean
METHOD isString(int64 v) RETURNS boolean
METHOD isArray(int64 v) RETURNS boolean
METHOD isObject(int64 v) RETURNS boolean
METHOD asBool(int64 v) RETURNS | boolean
METHOD asNumber(int64 v) RETURNS | number
METHOD asStringBytes(int64 v) RETURNS | int64
METHOD bytesRef() RETURNS REFERENCE binary[]
METHOD asString(int64 v) RETURNS | String
METHOD count(int64 v) RETURNS | int64
METHOD element(int64 a, int64 i) RETURNS | int64
METHOD lookupReference(int64 o, REFERENCE String key) RETURNS | int64
METHOD serialize(MUTABLE REFERENCE Serializer s) RETURNS STATUS
METHOD serializeNode(int64 v, MUTABLE REFERENCE Serializer s) RETURNS STATUS

CLASS DataValueBuilder

IMPLEMENTS Serializer

The document Serializer backend (ported from benchmarks/s09_json/envzn_newJson, serde-explicit-codecs design §6).

No frame object per container: one shared scratch stack. A container notes its base; its children are pushed as they arrive (array: one entry per element; object: key id, value); at its end they pop back into the document's pools — last first, so each lands at its final slot — until the scratch is back at base.

The typed events (putInt64 / putUint64 / putFloat64) store their node directly, and the byte events (putStringBytes / putKeyBytes) copy their window straight into the document's pools; the String forms encode to UTF-8 first.

result() hands back a copy and keeps the builder; takeResult() MOVES the document out and leaves the builder empty.

kernel/src/DataValueBuilder.ev:29

Constructors

INIT()
INIT(int64 sizeHint)

Methods

MODIFY METHOD putInt64(int64 v) RETURNS STATUS
MODIFY METHOD putUint64(uint64 v) RETURNS STATUS
MODIFY METHOD putFloat64(float64 v) RETURNS STATUS
MODIFY METHOD putNull() RETURNS STATUS
MODIFY METHOD putBool(boolean v) RETURNS STATUS
MODIFY METHOD putNumber(number v) RETURNS STATUS
MODIFY METHOD putStringBytes(REFERENCE binary[] src, int64 off, int64 len) RETURNS STATUS
MODIFY METHOD putString(REFERENCE String v) RETURNS STATUS
MODIFY METHOD putKeyBytes(REFERENCE binary[] src, int64 off, int64 len) RETURNS STATUS
MODIFY METHOD putKey(REFERENCE String key) RETURNS STATUS
MODIFY METHOD beginArray() RETURNS STATUS
MODIFY METHOD beginObject() RETURNS STATUS
MODIFY METHOD endArray() RETURNS STATUS
MODIFY METHOD endObject() RETURNS STATUS
METHOD result() RETURNS | DataValue
MODIFY METHOD takeResult() RETURNS | DataValue

CLASS DataValueReader

IMPLEMENTS Reconstructor

The document Reconstructor backend: a non-owning reader over a DataValue document (the two-layer-cake borrow pattern, like StringView over char32[]). It holds a REFERENCE DataValue and a position in it, never a copy; the document's lifetime must enclose the reader's.

Its position is a node: cur, the value the next read consumes (the root, or the start node it was created at). Opening a container pushes it on a stack of open containers; nextField / nextElement move cur to the next member value / element and pop the container after its last. So a read never walks the document and skipValue costs nothing: the next move steps over whatever cur holds.

nextField(type) matches the member's interned key against the names of type's reconstructable fields (not DERIVED, not CONSTANT) in place — ASCII names byte for byte, with no allocation (DataValue.keyIs).

read(sink) pushes the value at cur — the whole document for a fresh reader — into any Serializer (the walk lives on the document, DataValue.serializeNode).

kernel/src/DataValueReader.ev:29

Constructors

INIT(REFERENCE DataValue doc)
INIT(REFERENCE DataValue doc, int64 start)

Methods

MODIFY METHOD read(MUTABLE REFERENCE Serializer sink) RETURNS STATUS
MODIFY METHOD beginObject() RETURNS STATUS
MODIFY METHOD nextField(REFERENCE Identity type) RETURNS | int32
MODIFY METHOD beginArray() RETURNS STATUS
MODIFY METHOD nextElement() RETURNS | boolean
MODIFY METHOD readNull() RETURNS boolean
MODIFY METHOD readBool() RETURNS | boolean
MODIFY METHOD readInt64() RETURNS | int64
MODIFY METHOD readUint64() RETURNS | uint64
MODIFY METHOD readFloat64() RETURNS | float64
MODIFY METHOD readNumber() RETURNS | number
MODIFY METHOD readString() RETURNS | String
MODIFY METHOD skipValue() RETURNS STATUS

Serialisation

CLASS Fields

The kernel helpers that hold the serde rules (serde-explicit-codecs design §4.2-§4.4), so a type's serialize / reconstruct is one line per field per direction and the rules live here, not in every codec.

THE SLOT. Every method numbers a type's fields the way Reconstructor.nextField(type) does: the field's position in type.dataFields, every field counted. Which fields travel is the WRITER's decision, settled where the codec is written: a DERIVED or CONSTANT field is never written (I.P.d), and a reader only matches the keys the stream holds, so neither side asks per key. A key naming a field that never travels reaches the codec's unknown arm. IDENTITY(T) is read in place, which costs nothing.

THE SEEN-SET. A reconstruct marks each slot it read; complete then fails in STRICT for the first travelling field never marked (I.P k.i). Up to 64 slots the set is one int64 (mark / complete); past that it is an int64[] (markWide / completeWide). A negative index (UNKNOWN_FIELD) marks nothing, so a codec can mark after every arm.

THE CELLS. A type with no native document shape travels encoded (I.P.i): a ByteBuffer as a base64 string (Base64Codec), a DateTime as text in DATE_TIME_PATTERN. An enum travels as the pair {"name", "value"} (I.P.j) and reads back name first, then value, through EnumReflection. Each encode is total; each decode is fallible.

kernel/src/Fields.ev:33

Fields

  • int32 END_OF_OBJECT — nextField after the object's last member: the object is closed.
  • int32 UNKNOWN_FIELD — nextField on a key the type has no reconstructable field for.
  • String DATE_TIME_PATTERN — The wire form of a DateTime cell.
  • String CONSTANT_MODIFIER — The modifier prefix of a CONSTANT field, which never travels.

Methods

METHOD travels(REFERENCE IdentityField field) RETURNS boolean

Does field travel on the wire? Neither DERIVED nor CONSTANT. Asked only by the STRICT completeness check: a reader matches the keys the stream holds and never asks.

METHOD putKey(MUTABLE REFERENCE Serializer s, REFERENCE Identity type, int32 slot) RETURNS STATUS

Send the key of the field in type.dataFields[slot]. Which fields travel is the writer's decision, made where the codec is written: the helper only names the key.

METHOD unknown(MUTABLE REFERENCE Reconstructor source, ParseMode mode) RETURNS STATUS

A key the type does not have: skipped in LENIENT, refused in STRICT.

METHOD mark(int64 seen, int32 wire) RETURNS int64

seen with wire field wire marked; a negative index marks nothing.

METHOD complete(int64 seen, REFERENCE Identity type, ParseMode mode) RETURNS STATUS

STRICT: FAILURE naming the first travelling field whose slot seen never marked. LENIENT: SUCCESS.

METHOD mismatch(REFERENCE String typeName, REFERENCE String fieldName) RETURNS STATUS

The text of a value of the wrong shape for its field (a FAILURE in every mode).

METHOD missingText(REFERENCE String typeName, REFERENCE String fieldName) RETURNS String

": missing field ". Error texts here are built by appends, not format: in a template $1: reads as a format spec and eats the colon.

METHOD labelled(REFERENCE String head, REFERENCE String message) RETURNS String

": " — the same append-built form, for every Fields error.

METHOD markWide(MUTABLE REFERENCE int64[] seen, int32 wire) RETURNS void

Mark wire field wire in seen[wire / 64], growing seen to fit.

METHOD completeWide(REFERENCE int64[] seen, REFERENCE Identity type, ParseMode mode) RETURNS STATUS

complete over a wide seen-set: a word past the end of seen marks nothing.

METHOD putEnum(MUTABLE REFERENCE Serializer s, REFERENCE Identity enumType, int32 value) RETURNS STATUS

An enum case as the pair {"name": <case name>, "value": <backing integer>}.

METHOD readEnum(MUTABLE REFERENCE Reconstructor source, REFERENCE Identity enumType) RETURNS | int32

The pair back, keys in any order: the name resolves first, else the value; neither matching, a half of the wrong shape, or any other key is a FAILURE. The pair is pulled against IDENTITY(EnumKind), whose two fields are exactly name (wire 0) and value (wire 1).

METHOD putEnumName(MUTABLE REFERENCE Serializer s, REFERENCE Identity enumType, REFERENCE String caseName) RETURNS STATUS

An enum case by NAME, as the pair putEnum writes. Generated AUTO code names the case it holds; the value comes from IDENTITY(E).cases.

METHOD readEnumName(MUTABLE REFERENCE Reconstructor source, REFERENCE Identity enumType) RETURNS | String

readEnum, answering the resolved case's NAME.

METHOD putDuration(MUTABLE REFERENCE Serializer s, REFERENCE TimeDuration d) RETURNS STATUS

A TimeDuration as its ISO-8601 text (PT1H30M).

METHOD readDuration(MUTABLE REFERENCE Reconstructor source) RETURNS | TimeDuration

ISO-8601 duration text back to a TimeDuration; text that does not parse is a FAILURE.

METHOD putComplex(MUTABLE REFERENCE Serializer s, complex z) RETURNS STATUS
METHOD readComplex(MUTABLE REFERENCE Reconstructor source) RETURNS | complex

The pair back, keys in any order; a missing half is 0, any other key a FAILURE.

METHOD putBytes(MUTABLE REFERENCE Serializer s, REFERENCE ByteBuffer b) RETURNS STATUS

A ByteBuffer as a base64 string.

METHOD readBytes(MUTABLE REFERENCE Reconstructor source) RETURNS | ByteBuffer

A base64 string back to a ByteBuffer; malformed base64 is a FAILURE.

METHOD putDateTime(MUTABLE REFERENCE Serializer s, REFERENCE DateTime d) RETURNS STATUS

A DateTime as text in DATE_TIME_PATTERN.

METHOD readDateTime(MUTABLE REFERENCE Reconstructor source) RETURNS | DateTime

Text in DATE_TIME_PATTERN back to a DateTime; text that does not parse is a FAILURE.

INTERFACE Reconstructable

Reconstructable — the type-side read contract, the mirror of Serializable. reconstruct fills SELF from a source: it pulls each field from the Reconstructor (a nested object reconstructs its child in place), then calls RESTORE. mode is LENIENT (an unknown key skipped, a missing key defaulted) or STRICT (either is a FAILURE) — Constitution I.P(k.i). A type that is only ever written implements Serializable alone.

kernel/src/interfaces.ev:754

Methods

MODIFY METHOD reconstruct(MUTABLE REFERENCE Reconstructor source, ParseMode mode) RETURNS STATUS

INTERFACE Reconstructor

Reconstructor — a read source, PULLED from. The type asks for its next field and reads each value at the field's own type, so a typed read converts on the source's own representation and never builds a number:

  • beginObject opens the object the reader stands on; nextField(type) moves to its next member and answers the slot in type.dataFields of the field the key names (every field counted), Fields.UNKNOWN_FIELD for a key the type does not have, and Fields.END_OF_OBJECT after the last member (the object is then closed). The reader only matches the keys the stream holds. Which fields travel is the writer's decision: a DERIVED or CONSTANT field is never written, and a key naming one reaches the codec's unknown arm like any other stray key.
  • beginArray opens an array; nextElement moves to its next element, FALSE after the last (the array is then closed).
  • readNull is TRUE, and consumes the value, when the value is null.
  • readBool … readString read the value at one type; a value of the wrong shape for its read is a FAILURE in every mode (I.P k.i): readInt64 on "abc", on 1.5 or on a value past int64.
  • skipValue passes over one whole value, nested containers included.
  • read(sink) is the push form, for a consumer with no type (the DOM builder, a re-encoder): one whole value, pushed into the sink.

kernel/src/interfaces.ev:731

Methods

MODIFY METHOD beginObject() RETURNS STATUS
MODIFY METHOD nextField(REFERENCE Identity type) RETURNS | int32
MODIFY METHOD beginArray() RETURNS STATUS
MODIFY METHOD nextElement() RETURNS | boolean
MODIFY METHOD readNull() RETURNS boolean
MODIFY METHOD readBool() RETURNS | boolean
MODIFY METHOD readInt64() RETURNS | int64
MODIFY METHOD readUint64() RETURNS | uint64
MODIFY METHOD readFloat64() RETURNS | float64
MODIFY METHOD readNumber() RETURNS | number
MODIFY METHOD readString() RETURNS | String
MODIFY METHOD skipValue() RETURNS STATUS
MODIFY METHOD read(MUTABLE REFERENCE Serializer sink) RETURNS STATUS

INTERFACE Serializable

Serializable — the type-side write contract. serialize pushes the type's shape into the serializer (read-only on SELF; the MUTABLE REFERENCE param lets the sink's MODIFY methods be called).

kernel/src/interfaces.ev:706

Methods

METHOD serialize(MUTABLE REFERENCE Serializer s) RETURNS STATUS

INTERFACE Serializer

The serialization surface (serde-style, format-neutral) — four interfaces (serde-explicit-codecs design §4.3). A TYPE opts in by implementing Serializable (write) and/or Reconstructable (read); a FORMAT supplies the backends — the Json module a JsonWriter (Serializer) and a JsonReader (Reconstructor) over UTF-8 text, the kernel a DataValueBuilder (Serializer) and a DataValueReader (Reconstructor) over the DataValue document. The class names are irrelevant to a type: any Serializer drives the same serialize, any Reconstructor the same reconstruct. See Constitution I.P (Serialization and Reconstruction).

(Supersedes the earlier unused binary Serializable {encode()} / JSON_Serializer {toJson()} stubs, and the push-only Deserializer, whose deserialize(sink) is Reconstructor.read(sink).) Serializer — a write sink. A serializable type describes its shape by pushing a flat event stream into the serializer; the backend decides whether that becomes bytes (streaming) or a DataValue document. All methods mutate the sink.

Typed number events: putInt64 / putUint64 / putFloat64 carry a number at its own width, so a sink never builds a number for one; putNumber carries the rest of the tower.

Byte events: putStringBytes / putKeyBytes carry a string value / key as UTF-8 in src[off, off + len), UNESCAPED (a reader decodes escapes before the call). The window is valid only for the duration of the call — a sink that keeps the text copies it. The String forms stay for a type whose field IS a String.

kernel/src/interfaces.ev:686

Methods

MODIFY METHOD putNull() RETURNS STATUS
MODIFY METHOD putBool(boolean v) RETURNS STATUS
MODIFY METHOD putInt64(int64 v) RETURNS STATUS
MODIFY METHOD putUint64(uint64 v) RETURNS STATUS
MODIFY METHOD putFloat64(float64 v) RETURNS STATUS
MODIFY METHOD putNumber(number v) RETURNS STATUS
MODIFY METHOD putString(REFERENCE String v) RETURNS STATUS
MODIFY METHOD putStringBytes(REFERENCE binary[] src, int64 off, int64 len) RETURNS STATUS
MODIFY METHOD beginObject() RETURNS STATUS
MODIFY METHOD putKey(REFERENCE String key) RETURNS STATUS
MODIFY METHOD putKeyBytes(REFERENCE binary[] src, int64 off, int64 len) RETURNS STATUS
MODIFY METHOD endObject() RETURNS STATUS
MODIFY METHOD beginArray() RETURNS STATUS
MODIFY METHOD endArray() RETURNS STATUS

ENUM DataKind

DataKind — the public kind of one node of a DataValue document, the kernel's neutral, format-independent value model (the abstract shape shared by JSON, BSON, CBOR, MessagePack, and DB rows): DataValue.kind(v) answers it. The storage layer's own tag, DataNodeKind, is finer (three number kinds); this is the shape a reader asks about. Promoted from the Json module's Kind so the value model is a kernel citizen while wire formats stay in their modules (Json maps DataValue ↔ text).

kernel/src/enums.ev:259

Case Description
? —
? —
? —
? —
? —
? —

ENUM DataNodeKind

DataNodeKind — the tag of one DataNode in a DataValue document: the storage layer's kind. It is finer than the public DataKind (three number kinds, the width the value was written at); DataValue.kind(v) maps it onto DataKind. JNULL · JBOOL · JINT (int64) · JUINT (a uint64 past INT64_MAX) · JFLT (float64) · JSTR · JARR · JOBJ

kernel/src/enums.ev:317

Case Description
? —
? —
? —
? —
? —
? —
? —
? —

ENUM ParseMode

ParseMode — how a Reconstructable.reconstruct treats a document that does not match the type (I.P(k.i)): LENIENT skips an unknown key and defaults a missing one; STRICT refuses either. A value of the wrong shape fails in both.

kernel/src/enums.ev:310

Case Description
? —
? —

STRUCT DataNode

DataNode — one node of a DataValue document: a tag and two integer slots, read by the tag (a STRUCT stands in for C's union, so the arms share the slots):

k p n d JNULL - - - JBOOL 0 / 1 - - JINT the value - - JUINT a uint64 past INT64_MAX, its bits (NumericUtilities.toInt64) JFLT - - the value JSTR offset into the document's byte byte length - pool JARR first slot in items element count - JOBJ first slot in keys / vals member count -

A node is its int64 index in DataValue.nodes.

kernel/src/structs.ev:360

Fields

  • DataNodeKind k
  • int64 p
  • int64 n
  • float64 d

opaque

CLASS Opaque

opaque — type-erased value primitive.

Boxes a typed value behind a runtime type-tag for heterogeneous storage. It has exactly four methods: two statics called through the call-site template form opaque[T]->..., and two instance methods called on an opaque value d->....

opaque   d := opaque[Esquire]->wrap(myEsquire)
IF opaque[Esquire]->unwrap(d) THEN {              // pipe-XOR: moves the value out; d now empty
    Esquire e := $=
    String name := e->getName()                   // call methods on the value, never on d
}
boolean   b =  d->loaded()                        // FALSE only after a successful unwrap
opaque   c := d->clone()                          // non-destructive deep copy

opaque is not a parametric type. The [T] only appears at the call site of the two statics; the type position is always bare opaque (E2070).

No other method may be called on an opaque, whatever the receiver: a local, a parameter, a field, an opaque[] element or a call's result (E2078). To call a method on the value inside, unwrap it into a local or a field of the concrete type first.

opaque is move-only and bound like an object. Pass, store and return it with := (a plain opaque parameter owns its argument), and the source is consumed: reading it afterwards is E3010. = from another opaque would give one value two owners and is E3023. clone() is the only copy.

── C handles and UNSAFE (I.I.viii (c.i), (d)) ──────────────────────

A typed C pointer (FOREIGN_TYPE BIND (sqlite3 *) SQLITE3) lives only as a local inside an UNSAFE block: it may not be a field, a method parameter or a return type (E3037). A C handle that must persist across calls is held in an opaque field instead, the confinement-legal carrier. Inside an UNSAFE block the compiler converts between the opaque and the typed handle for you:

CLASS Database {
    PRIVATE opaque db                              // the persistent sqlite3*
    MODIFY METHOD open(String path) RETURNS (int32 rc) {
        UNSAFE {
            SQLITE3 handle
            rc = FOREIGN::sqlite3_open_v2(path, handle, flags, EMPTY)
            .db = handle                           // wraps the typed handle into the opaque
        }
        RETURN (rc)
    }
    METHOD close() RETURNS (int32 rc) {
        UNSAFE { rc = FOREIGN::sqlite3_close_v2(.db) }   // unwraps at the FOREIGN call
        RETURN (rc)
    }
}

The same conversion holds for an opaque local, for a declaration (opaque o = handle), for a LOAD out-parameter written straight into an opaque field, and for the explicit opaque[H]->wrap(h) / opaque[H]->unwrap(d), which are legal only inside UNSAFE (E3050). Outside the block no conversion is offered.

A C object has exactly one owner, so an opaque carrying a C handle has no copy: its clone() raises CloneError. Lend it with REFERENCE instead. An untyped void*, or an OS mutex or condition variable, belongs in UNSAFE.HANDLE / .MUTEX / .CONDVAR, whose field is the bare pointer with a null check; reach for opaque when the handle is typed and worth carrying behind a tag.

opaque is the sole member of GROUP Inoperative (interfaces.ev), which generic kernel containers test with WHEN T IS Inoperative to opt out of clone, copy and iteration paths over a payload they cannot see.

Runtime: PRIMITIVE Opaque below — a kind and a union, every read of the union behind its kind (opaque-union-storage-design.md), as number is backed by PRIMITIVE Number. A primitive or a C handle is stored in its own arm and allocates nothing; a class or interface object, or an array held in an OpaqueArrayCell, is the owning obj arm and carries its own class, which is what unwrap asks: a class payload matches by IS-A, so a wrapped Circle answers unwrap[Shape]. opaque[T]->wrap / ->unwrap are Opaque.wrap[T] / Opaque.unwrap[T], generic members instantiated per T.

Spec reference: ENVZN_CONSTITUTION.md I.D.v ("opaque — type-erased value") and I.I.viii (c.i), (d).

kernel/src/opaque.ev:121

Constructors

INIT()

Empty: UNLOADED, nothing held.

Methods

METHOD wrap(T value) RETURNS opaque
METHOD unwrap(MUTABLE REFERENCE opaque d) RETURNS | T
METHOD peek(REFERENCE opaque d) RETURNS H
METHOD loaded() RETURNS boolean

FALSE only when empty: never wrapped, or after a successful unwrap.

METHOD clone() RETURNS opaque

A copy of what it holds: an object through its own clone(), a value by value. A C handle has one owner and no copy (CloneError, I.D.v (c)).

UNION OpaqueType

kernel/src/opaque.ev:12

Fields

  • int8 i8
  • int16 i16
  • int32 i32
  • int64 i64
  • int128 i128
  • uint8 u8
  • uint16 u16
  • uint32 u32
  • uint64 u64
  • uint128 u128
  • float32 f32
  • float64 f64
  • boolean b
  • char8 c8
  • char16 c16
  • char32 c
  • binary o
  • number n
  • complex z
  • decimal128 d
  • HANDLE h
  • Cloneable obj

CLASS OpaqueArrayCell

IMPLEMENTS Cloneable

An array has no class of its own to carry, so an opaque holds it in one of these, in its obj arm: the cell's class says what the array is (OpaqueArrayCell[int32[]] is not OpaqueArrayCell[String[]]), and unwrap matches it with WHEN held IS OpaqueArrayCell[A] (opaque-union- storage-design §10 x4). A fixed-size array is never a payload (E2171).

kernel/src/OpaqueArrayCell.ev:16

Fields

  • A arr

Constructors

INIT(A value)

Methods

METHOD clone() RETURNS OpaqueArrayCell[A]

ENUM OpaqueKind

OpaqueKind — what an opaque holds (OpaqueStorage.ev). A primitive is its own kind; a C handle is HANDLE; a class, an interface object or an array (held in an OpaqueArrayCell) is OBJECT and carries its own class.

kernel/src/enums.ev:337

Case Description
? —
? —
? —
? —
? —
? —
? —
? —
? —
? —
? —
? —
? —
? —
? —
? —
? —
? —
? —
? —
? —
? —
? —