isRef (value -- value isRefLike)value: Current stack value whose Ref-like kind is tested.value: Preserved current stack value.isRefLike: Known Cond result that is TRUE when the current stack value is Ref-like.isRef is the current stack-value Ref-like predicate. It preserves the current stack value and reports whether that value is Ref-like.
In this builtin, Ref-like means Ref, Code, or Text. Current knownness, mutability, and NIL status do not change that category, so a known NIL Code value and an unknown Ref value are still Ref-like.
It answers the current stack-value question. The selected-item schema question is answered by fieldIsRef. A non-static In-place field can therefore make fieldIsRef return FALSE while a later read of that field makes isRef return TRUE.
TRUE means that the current stack value is Ref, Code, or Text.NIL status do not change the result for Ref, Code, or Text values.FALSE.dynamic, does not make that value Ref-like.NAME on an In-place local produces a Ref-like value, while a plain literal of the same schema does not.{} 0 {} [
plain: 7;
unknownText: 0 ("") dynamic @;
dict: { ordinaryField: 8; };
"-- field schema versus read result --" printCompilerMessage
dict 0 fieldIsRef printStack _:;
0 @dict @ isRef printStack _:; _:;
"-- In-place values --" printCompilerMessage
7 isRef printStack _:; _:;
0 dynamic isRef printStack _:; _:;
plain isRef printStack _:; _:;
@plain isRef printStack _:; _:;
"-- Ref-like also includes Text and Code --" printCompilerMessage
"hi" isRef printStack _:; _:;
unknownText isRef printStack _:; _:;
{} () {} codeRef isRef printStack _:; _:;
"-- meta value --" printCompilerMessage
() isRef printStack _:; _:;
0
] "main" exportFunction
-- field schema versus read result --
FALSE
8 Ref
TRUE
-- In-place values --
7
FALSE
0
FALSE
7 Cref
TRUE
7 Ref
TRUE
-- Ref-like also includes Text and Code --
"hi"
TRUE
Text
TRUE
{} () {} codeRef CNIL
TRUE
-- meta value --
()
FALSE
const builtin (value -- immutableView) Immutable view conversion for the current stack value.fieldIsRef builtin (schema ordinal -- isRefLike) Ref-like test for one selected item schema.isConst builtin (value -- isConst) Current stack-value immutability test.managed? builtin (schema -- isManaged) Managed-lifetime schema test.unconst builtin (value -- mutableView) Mutable view conversion for the current stack value.