isDynamic (object -- isDynamic)
Inputs
object: Current stack object whose stable-and-unknown state is tested.
Outputs
isDynamic: KnownCondresult of the current unknownness-and-stability test; it is the same predicate asunknownStable?.
isDynamic tests whether an In-place object is currently stable and has an unknown value. For a non-Meta Struct, every solid field must meet that condition; the predicate is the same as unknownStable? and does not itself forget values or change stability.
This predicate follows the referenced target for known non-NIL Ref objects. It is the same predicate as unknownStable?. Mere lack of compile-time knownness is not enough, so Text, Code, and Meta objects still report FALSE. This includes callable non-NIL Code objects and known NIL Code objects.
Behavior
- An In-place object with unknown contents reports
TRUEonly while it is stable; an unstable object reportsFALSE. - A fully known In-place object reports
FALSE. - A known non-
NILRef object reports theunknownStable?result of its target. - Known
NILRef objects and unknown Ref objects reportFALSE.
Example
{} 0 {} [
value: 7;
codeLocal: {} () {} codeRef;
unknownValue: 0 dynamic;
unknownText: 0 ("") dynamic @; # an unknown Text
[] !codeLocal # a non-NIL Code
"-- same as unknownStable? for In-place values --" printCompilerMessage
7 known? printStack _:;
7 isDynamic printStack _:;
7 unknownStable? printStack _:;
unknownValue known? printStack _:;
unknownValue isDynamic printStack _:;
unknownValue unknownStable? printStack _:;
"-- same as unknownStable? for references --" printCompilerMessage
@value isDynamic printStack _:;
@value unknownStable? printStack _:;
@value dynamic isDynamic printStack _:;
@value dynamic unknownStable? printStack _:;
0nx value addressToReference isDynamic printStack _:; # a NIL Ref
0nx value addressToReference unknownStable? printStack _:;
"-- same as unknownStable? for text, code, meta --" printCompilerMessage
"hi" isDynamic printStack _:;
"hi" unknownStable? printStack _:;
unknownText isDynamic printStack _:;
unknownText unknownStable? printStack _:;
{} () {} codeRef isDynamic printStack _:;
{} () {} codeRef unknownStable? printStack _:;
@codeLocal isDynamic printStack _:;
@codeLocal unknownStable? printStack _:;
() isDynamic printStack _:;
() unknownStable? printStack _:;
0
] "main" exportFunction
Expected Output During Compilation
-- same as unknownStable? for In-place values --
TRUE
FALSE
FALSE
FALSE
TRUE
TRUE
-- same as unknownStable? for references --
FALSE
FALSE
TRUE
TRUE
FALSE
FALSE
-- same as unknownStable? for text, code, meta --
FALSE
FALSE
FALSE
FALSE
FALSE
FALSE
FALSE
FALSE
FALSE
FALSE
See also
isDirtybuiltin(object -- isDirty)Current stack-object instability predicate; exact opposite ofstable?.dynamicbuiltin(object -- dynamicValue)Current stack-object forgotten-contents conversion.isStaticbuiltin(object -- isKnown)Historical name of the same current stack-object knownness predicate.known?builtin(object -- isKnown)Preferred public name of the same current stack-object knownness predicate.stable?builtin(object -- isStable)Current stack-object stability predicate; exact opposite ofisDirty.unknownStable?builtin(object -- isUnknownStable)Same current stable-and-unknown predicate under a different builtin name.