fieldRead (structValue ordinal -- selectedItem)structValue: Struct value or Ref to Struct from which the selected item is read.ordinal: Zero-based item ordinal used for selection.selectedItem: Stack value produced by reading the selected item.fieldRead reads one selected item by zero-based item ordinal, with the Struct value before the ordinal. Both inputs are dereferenced first.
Selection happens inside the builtin from data inputs. fieldRead does not call callable items automatically. A mutable Ref result from a non-static In-place item can serve as the already-selected destination for set.
ordinal input must be a non-NIL Int32.structValue was reached mutably and an immutable Ref otherwise.fieldIsRef and fieldIsVirtual describe the selected item schema, not the stack result produced by fieldRead. A non-static In-place item can therefore yield a Ref result even when fieldIsRef is FALSE, while a static or Meta item can still yield a copied or newly constructed result even when fieldIsVirtual is TRUE.
{} 0 {} [
dict: {
ordinaryField: 0;
staticField: 1 virtual;
textField: 0 ("") dynamic @;
codeField: {} () {} codeRef;
metaField: ();
};
list: (1 2) dynamic;
ordinal: 0 dynamic;
"-- In-place field through mutable struct --" printCompilerMessage
@dict 0 fieldRead printStack _:;
"-- In-place field through immutable struct --" printCompilerMessage
dict 0 fieldRead printStack _:;
"-- static field --" printCompilerMessage
dict 1 fieldIsVirtual printStack _:;
@dict 1 fieldRead printStack _:;
"-- text field --" printCompilerMessage
@dict 2 fieldRead printStack _:;
"-- code field --" printCompilerMessage
@dict 3 fieldRead printStack _:;
"-- meta field --" printCompilerMessage
@dict 4 fieldRead printStack _:;
"-- uniform struct through unknown ordinal --" printCompilerMessage
@list ordinal fieldRead printStack _:;
0
] "main" exportFunction
-- In-place field through mutable struct --
0 Ref
-- In-place field through immutable struct --
0 Cref
-- static field --
TRUE
1
-- text field --
Text
-- code field --
{} () {} codeRef CNIL
-- meta field --
()
-- uniform struct through unknown ordinal --
Int32 Ref
.@NAME node source form Named field read without calling..NAME node source form Named field mention and call if callable.! builtin (value ordinal structTarget --) Ordinal-based data-input selection and write with the ordinal before the Struct target.@ builtin (ordinal structValue -- selectedItem) Ordinal-based data-input selection and read with the ordinal before the Struct value. Callable items are read, not called.callField builtin (dict name -- fieldResult) Known-name data-input Dict field selection with .NAME-style field handling. Callable fields are called; non-callable fields are read.fieldIsRef builtin (schema ordinal -- isRefLike) Ref-like test for one selected item schema.fieldIsVirtual builtin (schema ordinal -- hasNoStorage) No-storage test for one selected item.fieldWrite builtin (value structTarget ordinal --) Ordinal-based data-input selection and write with the Struct target before the ordinal.set builtin (value destination --) Final replacement step after a separate selection form such as a mutable fieldRead result.