managed? (schema -- isManaged)
Inputs
schema: Object orRefwhose dereferenced schema is tested for managed lifetime.
Outputs
managed? is a dereferenced-schema predicate. It tests whether the dereferenced schema has managed lifetime behavior.
Ref inputs are followed before the test. Current value contents, current value state, and current view qualifiers do not participate. Applying dynamic, const, or unconst therefore does not change the result as long as the dereferenced schema stays the same.
Behavior
- Schemas with managed lifetime behavior report
TRUE. Plain Int32, Text, and Meta schemas reportFALSE. - Current state predicates such as
known?,stable?, andisDirtyanswer different questions and do not determine this result.
Example
"Owner" use
{} 0 {} [
owned: 7 owner;
"-- common results --" printCompilerMessage
7 owner managed? printStack _:;
7 managed? printStack _:;
"hi" managed? printStack _:;
() managed? printStack _:;
"-- references are followed --" printCompilerMessage
owned managed? printStack _:;
@owned managed? printStack _:;
"-- current contents do not matter --" printCompilerMessage
7 owner managed? printStack _:;
7 owner dynamic managed? printStack _:;
7 managed? printStack _:;
7 dynamic managed? printStack _:;
"-- different question from stable? --" printCompilerMessage
"hi" managed? printStack _:;
"hi" stable? printStack _:;
() managed? printStack _:;
() stable? printStack _:;
0
] "main" exportFunction
Expected Output During Compilation
-- common results --
TRUE
FALSE
FALSE
FALSE
-- references are followed --
TRUE
TRUE
-- current contents do not matter --
TRUE
TRUE
FALSE
FALSE
-- different question from stable? --
FALSE
TRUE
FALSE
TRUE
See also
alignmentbuiltin(schema -- alignment)Returns the storage alignment requirement of the dereferenced schema.code?builtin(schema -- isBlock)HistoricalBlockdereferenced-schema test.codeRef?builtin(schema -- isCode)Codedereferenced-schema test.isCombinedbuiltin(schema -- isCombined)Struct-group dereferenced-schema test.samebuiltin(leftSchema rightSchema -- isSameSchema)Exact dereferenced-schema equality test.schemaNamebuiltin(schema -- reportedName)Reported name of the dereferenced schema.stable?builtin(object -- isStable)Current stack-object stability predicate, not a schema-lifetime test.storageSizebuiltin(schema -- size)Returns the storage size of the dereferenced schema.virtual?builtin(schema -- isMeta)Historical Meta-schema test.