virtual? (schema -- isMeta)The name is historical. virtual? is a dereferenced-schema predicate. It tests whether the dereferenced schema is Meta.
It does not test whether a value or item was declared with virtual or whether a selected Struct item lacks runtime field storage. A static item can therefore make fieldIsVirtual return TRUE while a later read of that item makes virtual? return FALSE.
Ref inputs are followed before the test. Current value contents do not participate.
schema.TRUE means the schema is Meta.virtual.fieldIsVirtual instead asks whether a selected Struct item lacks runtime field storage.{} 0 {} [
virtual staticLocal: 0;
dict: {
ordinaryField: 0;
staticField: 0 virtual;
metaField: ();
};
"-- In-place field read result --" printCompilerMessage
@dict 0 fieldRead virtual? printStack _:;
dict 0 fieldIsVirtual printStack _:;
"-- static field read result --" printCompilerMessage
@dict 1 fieldRead virtual? printStack _:;
dict 1 fieldIsVirtual printStack _:;
"-- meta field read result --" printCompilerMessage
@dict 2 fieldRead virtual? printStack _:;
dict 2 fieldIsVirtual printStack _:;
"-- value declared with virtual is still not meta --" printCompilerMessage
staticLocal virtual? printStack _:;
0
] "main" exportFunction
-- In-place field read result --
FALSE
FALSE
-- static field read result --
FALSE
TRUE
-- meta field read result --
TRUE
TRUE
-- value declared with virtual is still not meta --
FALSE
alignment builtin (schema -- alignment) Returns the storage alignment requirement of the dereferenced schema.fieldIsVirtual builtin (schema ordinal -- hasNoStorage) Selected-item storage predicate for one Struct item.virtual builtin (--) Historical static-declaration modifier for the next local.code? builtin (schema -- isBlock) Historical Block dereferenced-schema test.codeRef? builtin (schema -- isCode) Code dereferenced-schema test.isCombined builtin (schema -- isCombined) Struct-group dereferenced-schema test.managed? builtin (schema -- isManaged) Managed-lifetime dereferenced-schema test.same builtin (leftSchema rightSchema -- isSameSchema) Exact dereferenced-schema equality test.schemaName builtin (schema -- reportedName) Reported name of the dereferenced schema.storageSize builtin (schema -- size) Returns the storage size of the dereferenced schema.