codeRef? (schema -- isCode)codeRef? is a dereferenced-schema predicate. It tests whether the dereferenced schema is Code.
The name is historical: codeRef? is the Code test, while code? is the Block test.
Ref inputs are followed before the test. Current value contents do not participate, and the result does not distinguish known NIL Code, unknown Code, and usable non-NIL Code values.
codeRef? is not a usability test. Known NIL, unknown, and usable non-NIL Code values all still report TRUE because only the schema participates.
schema.TRUE means the schema is Code.Code schemas, including Block and Text, report FALSE."String" use
{} 0 {} [
codeLocal: {} () {} codeRef;
[("-- code call --\n") printList] !codeLocal
"-- codeRef? versus code? --" printCompilerMessage
{} () {} codeRef codeRef? printStack _:;
{} () {} codeRef code? printStack _:;
@codeLocal codeRef? printStack _:;
@codeLocal code? printStack _:;
"-- not a general callability test --" printCompilerMessage
{} () {} codeRef dynamic codeRef? printStack _:;
[] codeRef? printStack _:;
«1 +» codeRef? printStack _:;
@codeLocal call
0
] "main" exportFunction
Module-loading wrapper lines are omitted below.
-- codeRef? versus code? --
TRUE
FALSE
TRUE
FALSE
-- not a general callability test --
TRUE
FALSE
FALSE
-- code call --
alignment builtin (schema -- alignment) Returns the storage alignment requirement of the dereferenced schema.call builtin (callable -- calledResult) Calls an already-selected callable instead of testing its schema.code? builtin (schema -- isBlock) Historical Block dereferenced-schema test.codeRef builtin (inputsSchema output options -- code) Constructs a Code schema and a known NIL Code value of that schema.isCombined builtin (schema -- isCombined) Struct-group dereferenced-schema test.managed? builtin (schema -- isManaged) Managed-lifetime dereferenced-schema test.same builtin (leftSchema rightSchema -- isSameSchema) Exact dereferenced-schema equality test.schemaName builtin (schema -- reportedName) Reported name of the dereferenced schema.storageSize builtin (schema -- size) Returns the storage size of the dereferenced schema.virtual? builtin (schema -- isMeta) Historical Meta dereferenced-schema test.