isDirty

isDirty (value -- isDirty)

Inputs

Outputs

isDirty is the current stack-value instability predicate. It tests whether the current stack value is currently unstable.

This predicate follows the referenced target for known non-NIL Ref values. It is the exact opposite of stable?. It does not report whether storage was modified, and compile-time knownness or forgotten-contents state alone do not determine the result. Current stack Code values are tested by the current Code value itself, not by callability. User-visible creation paths such as codeRef and block assignment to Code still report TRUE.

Behavior

Example

{} 0 {} [
  value: 7;
  unknownValue: 0 dynamic;
  unknownText: 0 ("") dynamic @;
  codeLocal: {} () {} codeRef;
  [] !codeLocal

  "-- 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 _:;
  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