virtual? (schema -- isMeta)
Inputs
schema: Object orRefwhose dereferenced schema is tested for Meta status.
Outputs
The name is historical. virtual? is a dereferenced-schema predicate. It tests whether the dereferenced schema is Meta.
It does not test whether an object 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.
Example
{} 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
Expected Output During Compilation
-- 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
See also
alignmentbuiltin(schema -- alignment)Returns the storage alignment requirement of the dereferenced schema.fieldIsVirtualbuiltin(schema ordinal -- hasNoStorage)Selected-item storage predicate for one Struct item.virtualbuiltin(--)Historical static-declaration modifier for the next local.code?builtin(schema -- isBlock)HistoricalBlockdereferenced-schema test.codeRef?builtin(schema -- isCode)Codedereferenced-schema test.isCombinedbuiltin(schema -- isCombined)Struct-group dereferenced-schema test.managed?builtin(schema -- isManaged)Managed-lifetime dereferenced-schema test.samebuiltin(leftSchema rightSchema -- isSameSchema)Exact dereferenced-schema equality test.schemaNamebuiltin(schema -- reportedName)Reported name of the dereferenced schema.storageSizebuiltin(schema -- size)Returns the storage size of the dereferenced schema.