Static object-formatting helpers and dictionary-shape manipulation utilities.
formatObjectStatic (object options -- text): dispatches formatting by the supplied object schema.formatStructStatic (struct options -- text): formats one Struct value and delegates to dict or tuple formatting according to the input shape.formatDictStatic (dict options -- text) and formatTupleStatic (tuple options -- text): format static dictionary and tuple values.formatIntegerStatic, formatRealStatic, formatCondStatic, formatTextStatic, formatCodeStatic, and formatCodeRefStatic: format the corresponding scalar, text, or code classes.formatCodeStatic returns Code rather than token text.base: integer output base used by formatIntegerStatic.dictIndent: current indentation depth for multi-line dictionary formatting.tupleIndent: current indentation depth for multi-line tuple formatting.expandCode: when true, formatCodeStatic expands code tokens instead of returning Code.cloneDict (dict -- clone): clones one dictionary field by field while preserving field order.insertField (dict value name ordinal -- result): inserts one field with the supplied name at the supplied ordinal.removeField (dict ordinal -- result): removes the field at the supplied ordinal.transferField: helper used while rebuilding dictionary shapes.fieldNeedsVirtual (dict ordinal -- valid): reports whether reinserting the selected field requires the virtual modifier.unwrapField (dict ordinal -- value): returns one transfer-ready value for the selected field.unwrapFields (dict -- values): unwraps all fields in order."objectTools" use
"control" use
{} () {} [
{x: 255n32; y: (1i32 2i32);} {base: 16; dictIndent: 0; tupleIndent: 0;} formatObjectStatic printStack _:;
] "main" exportFunction
"{
x: 0xFFn32;
y: (
0x1
0x2
);
}"
"objectTools" use
"control" use
{} () {} [
{x: 1i32; z: 3i32;} {value: 2i32;} "y" 1 insertField printStack _:;
] "main" exportFunction
{
x: 1;
y: 2;
z: 3;
}
"objectTools" use
"control" use
{} () {} [
{x: 1i32; y: 2i32; z: 3i32;} 1 removeField printStack _:;
] "main" exportFunction
{
x: 1;
z: 3;
}
"objectTools" use
"String" use
"control" use
{} Int32 {} [
inserted: {x: 1i32; z: 3i32;} {value: 2i32;} "y" 1 insertField;
inserted.y 2 same print
LF print
removed: inserted 1 removeField;
removed fieldCount 2 same print
LF print
0
] "main" exportFunction
TRUE
TRUE