schemaName (schema -- reportedName)
Inputs
schema: Object orRefwhose dereferenced schema is the one being named.
Outputs
schemaName is a dereferenced-schema naming query. It returns the reported name of the dereferenced schema as known Text.
Without a valid override, the result is the default formatted name of the dereferenced schema.
Only a Dict schema overrides that default, and only with a static Text field named SCHEMA_NAME. Current value contents do not participate. Matching reported names still do not imply same.
schemaName is descriptive only. Use same when exact dereferenced-schema identity matters.
Behavior
- A static Text
SCHEMA_NAMEwhose value isNILis invalid; it does not select the fallback. - Two different schemas can still report the same name.
Example
{} () {} [
value: 0 dynamic;
"-- dereferenced schema --" printCompilerMessage
value schemaName printStack _:;
@value schemaName printStack _:;
named: {
SCHEMA_NAME: "Greeting" virtual;
value: 0;
};
"-- static text override --" printCompilerMessage
named schemaName printStack _:;
@named schemaName printStack _:;
"-- ignored overrides --" printCompilerMessage
{
SCHEMA_NAME: 0 ("Temp") dynamic @;
value: 0;
} schemaName printStack _:;
{
SCHEMA_NAME: 0 virtual;
value: 0;
} schemaName printStack _:;
] "main" exportFunction
Expected Output During Compilation
-- dereferenced schema --
"Int32"
"Int32"
-- static text override --
"Greeting"
"Greeting"
-- ignored overrides --
"{SCHEMA_NAME: Text; value: Int32;}"
"{SCHEMA_NAME: 0 virtual; value: Int32;}"
See also
alignmentbuiltin(schema -- alignment)Layout-alignment query of the dereferenced schema.fieldCountbuiltin(schema -- itemCount)Item count of the dereferenced Struct schema.fieldIndexbuiltin(schema itemName -- ordinal)Selected item ordinal from item name under last-match rules.fieldIsRefbuiltin(schema ordinal -- isRefLike)Ref-like test for one selected item schema.fieldIsVirtualbuiltin(schema ordinal -- hasNoStorage)No-storage test for one selected item.fieldNamebuiltin(schema ordinal -- itemName)Stored item name at one selected item ordinal.hasbuiltin(schema itemName -- hasName)Schema-level known-name presence test.samebuiltin(leftSchema rightSchema -- isSameSchema)Exact dereferenced-schema equality test.storageSizebuiltin(schema -- size)Layout-size query of the dereferenced schema.