isDirty (object -- isDirty)
Inputs
object: Current stack object whose dirty state is tested.
Outputs
isDirty is the current stack-object instability predicate. It tests whether the current stack object is currently unstable.
This predicate follows the referenced target for known non-NIL Ref objects. It is the exact opposite of stable?. It does not report whether storage was modified, and compile-time knownness or unknownness alone do not determine the result.
Behavior
- A fully known or forgotten-contents In-place object reports
FALSE. - A known non-
NILRef object reports the current instability of its referenced target. This follows target instability, not target knownness. - Known
NILRef objects and unknown Ref objects reportTRUE. - Text objects report
FALSEonly when they are known and non-NIL. Codeobjects are tested by the currentCodeobject itself, not by callability. User-visible creation paths such ascodeRefand block assignment toCodestill reportTRUE.- Meta objects report
FALSE.
Example
{} 0 {} [
value: 7;
unknownValue: 0 dynamic;
unknownText: 0 ("") dynamic @; # an unknown Text
codeLocal: {} () {} codeRef;
[] !codeLocal # a non-NIL Code
"-- stable? versus isDirty for In-place values --" printCompilerMessage
7 known? printStack _:;
7 stable? printStack _:;
7 isDirty printStack _:;
7 unknownStable? printStack _:;
7 isDynamic printStack _:;
unknownValue known? printStack _:;
unknownValue stable? printStack _:;
unknownValue isDirty printStack _:;
unknownValue unknownStable? printStack _:;
unknownValue isDynamic printStack _:;
"-- stable? versus isDirty for references --" printCompilerMessage
@value stable? printStack _:;
@value isDirty printStack _:;
@value unknownStable? printStack _:;
@value isDynamic printStack _:;
@unknownValue stable? printStack _:;
@unknownValue isDirty printStack _:;
@unknownValue unknownStable? printStack _:;
@unknownValue isDynamic printStack _:;
0nx value addressToReference stable? printStack _:; # a NIL Ref
0nx value addressToReference isDirty printStack _:;
0nx value addressToReference unknownStable? printStack _:;
0nx value addressToReference isDynamic printStack _:;
"-- stable? versus isDirty for text, code, meta --" printCompilerMessage
"hi" stable? printStack _:;
"hi" isDirty printStack _:;
unknownText stable? printStack _:;
unknownText isDirty printStack _:;
{} () {} codeRef stable? printStack _:;
{} () {} codeRef isDirty printStack _:;
@codeLocal isDirty printStack _:;
() stable? printStack _:;
() isDirty printStack _:;
0
] "main" exportFunction
Expected Output During Compilation
-- stable? versus isDirty for In-place values --
TRUE
TRUE
FALSE
FALSE
FALSE
FALSE
TRUE
FALSE
TRUE
TRUE
-- stable? versus isDirty for references --
TRUE
FALSE
FALSE
FALSE
TRUE
FALSE
TRUE
TRUE
FALSE
TRUE
FALSE
FALSE
-- stable? versus isDirty for text, code, meta --
TRUE
FALSE
FALSE
TRUE
FALSE
TRUE
TRUE
TRUE
FALSE
See also
dynamicbuiltin(object -- dynamicValue)Current stack-object forgotten-contents conversion.isDynamicbuiltin(object -- isDynamic)Current stable-and-unknown predicate; same predicate asunknownStable?.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)Current stable-and-unknown predicate; same predicate asisDynamic.