code? (schema -- isBlock)code? is a dereferenced-schema predicate. It tests whether the dereferenced schema is Block.
The name is historical: code? is the Block test, while codeRef? is the Code test.
Ref inputs are followed before the test. Current value contents do not participate, and the result does not report general callability.
code? is not a general callability test. Use codeRef? for Code schemas and call to attempt an actual call.
schema.TRUE means the schema is Block.Block schemas, including Code and Text, report FALSE."String" use
{} 0 {} [
codeLocal: {} () {} codeRef;
textLocal: 0 ("") dynamic @;
[("-- code call --\n") printList] !codeLocal
"-- code? versus codeRef? --" printCompilerMessage
[("-- block call --\n") printList] code? printStack _:;
[("-- block call --\n") printList] codeRef? printStack _:;
@codeLocal code? printStack _:;
@codeLocal codeRef? printStack _:;
"-- not a general callability test --" printCompilerMessage
«1 +» code? printStack _:;
textLocal code? printStack _:;
[("-- block call --\n") printList] call
@codeLocal call
0
] "main" exportFunction
Module-loading wrapper lines are omitted below.
-- code? versus codeRef? --
TRUE
FALSE
FALSE
TRUE
-- not a general callability test --
FALSE
FALSE
-- block call --
-- 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.codeRef? builtin (schema -- isCode) Code dereferenced-schema test.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.