managed?

managed? (schema -- isManaged)

Inputs

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

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

Module-loading wrapper lines are omitted below.

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