has (schema itemName -- hasName)schema: Value or Ref whose dereferenced schema is searched for the requested name.itemName: Known non-NIL Text name being tested for presence.Tests whether the dereferenced schema contains at least one item matching the requested known name.
The name must be known, non-NIL Text. This is a known-name presence test, not a selected-item ordinal lookup. Any matching item makes the result TRUE.
Only the schema participates. Current value contents do not participate.
has uses the same name-matching rules as fieldIndex, but it stops at presence and does not return which ordinal matched.
TRUE if at least one field has the requested name.TRUE; the builtin never reports which ordinal matched."" also matches unnamed items."" matches, and it matches only when the Struct object is non-empty.FALSE.{} () {} [
mixed: { 1 "" def x: 1; y: 2; };
"-- Dict field names --" printCompilerMessage
mixed "x" has printStack _:;
@mixed "x" has printStack _:;
"-- empty name --" printCompilerMessage
mixed "" has printStack _:;
(1 FALSE) "" has printStack _:;
() "" has printStack _:;
"-- missing name --" printCompilerMessage
mixed "z" has printStack _:;
(1 FALSE) "x" has printStack _:;
] "main" exportFunction
-- Dict field names --
TRUE
TRUE
-- empty name --
TRUE
TRUE
FALSE
-- missing name --
FALSE
FALSE
fieldCount builtin (schema -- itemCount) Schema item count and valid ordinal-range upper bound.fieldIndex builtin (schema itemName -- ordinal) Name-to-ordinal lookup under last-match rules.fieldIsRef builtin (schema ordinal -- isRefLike) Ref-like test for one selected item schema.fieldIsVirtual builtin (schema ordinal -- hasNoStorage) No-storage test for one selected item.fieldName builtin (schema ordinal -- itemName) Ordinal-to-name lookup that preserves the stored name at one selected ordinal.schemaName builtin (schema -- reportedName) Reported name of the dereferenced schema.