addressToReference (address modelValue -- reconstructedValue)address: Numeric storage address to interpret.modelValue: Value that supplies the result schema case. When it is Ref-like, it also supplies the result mutability.reconstructedValue: Value reconstructed from the address and model value schema.addressToReference reconstructs a typed result from a numeric storage address and a model value.
The model value is used only to choose the result schema case and, for Ref-like model values, the result mutability. It is not dereferenced and it is not read from the supplied address.
If the model value is already Ref-like, the result has that same schema. Otherwise, a non-Meta non-Ref-like model produces a Ref to the model schema. For an In-place local or field, NAME or .NAME supplies the immutable Ref model case, while @NAME or .@NAME supplies the mutable case.
Meta non-Ref-like model value produces a Ref to the model schema at the supplied address.Ref-like model values, that implied schema is the corresponding Ref schema.Ref-like model value produces a mutable Ref result to the same schema.{} () {} [
value: 7;
text: "hello";
code: {} () {} codeRef;
"-- Ref model value --" printCompilerMessage
@value storageAddress @value addressToReference printStack _:;
0nx @value addressToReference printStack _:;
"-- In-place model value --" printCompilerMessage
@value storageAddress value addressToReference printStack _:;
0nx value addressToReference printStack _:;
"-- text and code targets --" printCompilerMessage
text storageAddress text addressToReference printStack _:;
0nx text addressToReference printStack _:;
0nx @code addressToReference printStack _:;
] "main" exportFunction
-- Ref model value --
Int32 Ref
Int32 NIL
-- In-place model value --
Int32 Cref
Int32 CNIL
-- text and code targets --
Text
Text CNIL
{} () {} codeRef CNIL
alignment builtin (schema -- alignment) Returns the storage alignment requirement of the dereferenced schema.manuallyDestroyVariable builtin (value --) Manually destroys the designated value in place without freeing the storage.manuallyInitVariable builtin (value --) Manually initializes the designated value in existing storage without allocating the storage.storageAddress builtin (value -- address) Current stack-value storage query; known NIL Ref, Text, and Code values produce 0nx.storageSize builtin (schema -- size) Returns the storage size of the dereferenced schema.