isStatic (object -- isKnown)
Inputs
object: Current stack object tested by the historical knownness predicate.
Outputs
isKnown: KnownCondresult that isTRUEwhen the current stack object has a value fully known at compile time under the historical builtin name.
isStatic is the historical name of the knownness predicate for the current stack object. It tests whether the object's value is fully known at compile time.
This predicate follows the referenced target for known non-NIL Ref objects. For In-place storage, stability alone is insufficient for TRUE: a stable object may be unknown and reports FALSE, and an unstable or forgotten In-place object reports FALSE; other schemas use their own knownness rules. Current stack Code objects produced by user-visible creation paths such as codeRef, exportFunction, and block assignment to Code still report FALSE. This includes callable non-NIL Code objects reached through those paths and known NIL Code objects.
Behavior
- A fully known In-place object reports
TRUE. - An In-place object whose concrete contents have been forgotten, for example by
dynamic, reportsFALSE. - For Ref objects,
isStatictests whether the referenced target is fully known, not merely whether a non-NILRef object exists on the stack. - A known non-
NILRef object to an unknown target reportsFALSE. - Known non-
NILText objects reportTRUE, while knownNILand unknown Text objects reportFALSE. - Meta objects report
TRUE.
Example
{} 0 {} [
knownValue: 7;
codeLocal: {} () {} codeRef;
unknownValue: 0 dynamic;
unknownText: 0 ("") dynamic @; # an unknown Text
[] !codeLocal # a non-NIL Code
"-- same as known? for In-place values --" printCompilerMessage
7 isStatic printStack _:;
7 known? printStack _:;
unknownValue isStatic printStack _:;
unknownValue known? printStack _:;
unknownValue stable? printStack _:;
"-- same as known? for references --" printCompilerMessage
@knownValue isStatic printStack _:;
@knownValue known? printStack _:;
@unknownValue isStatic printStack _:;
@unknownValue known? printStack _:;
0nx knownValue addressToReference isStatic printStack _:; # a NIL Ref
0nx knownValue addressToReference known? printStack _:;
"-- same as known? for text, meta, code --" printCompilerMessage
"hi" isStatic printStack _:;
"hi" known? printStack _:;
0nx "" addressToReference isStatic printStack _:;
0nx "" addressToReference known? printStack _:;
unknownText isStatic printStack _:;
unknownText known? printStack _:;
() isStatic printStack _:;
() known? printStack _:;
{} () {} codeRef isStatic printStack _:;
{} () {} codeRef known? printStack _:;
@codeLocal isStatic printStack _:;
@codeLocal known? printStack _:;
0
] "main" exportFunction
Expected Output During Compilation
-- same as known? for In-place values --
TRUE
TRUE
FALSE
FALSE
TRUE
-- same as known? for references --
TRUE
TRUE
FALSE
FALSE
FALSE
FALSE
-- same as known? for text, meta, code --
TRUE
TRUE
FALSE
FALSE
FALSE
FALSE
TRUE
TRUE
FALSE
FALSE
FALSE
FALSE
See also
dynamicbuiltin(object -- dynamicValue)Current stack-object forgotten-contents conversion.isDirtybuiltin(object -- isDirty)Current stack-object instability predicate; exact opposite ofstable?.isDynamicbuiltin(object -- isDynamic)Current stable-and-unknown predicate; same predicate asunknownStable?.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.