objectTools

Static object-formatting helpers and dictionary-shape manipulation utilities.


Static formatting surface


Formatting options


Dictionary reshaping helpers


Unwrap helpers


Examples

Formatting options

"objectTools" use
"control" use

{} () {} [
  {x: 255n32; y: (1i32 2i32);} {base: 16; dictIndent: 0; tupleIndent: 0;} formatObjectStatic printStack _:;
] "main" exportFunction

Expected Output During Compilation

"{
  x: 0xFFn32;
  y: (
  0x1
  0x2
);
}"

insertField

"objectTools" use
"control" use

{} () {} [
  {x: 1i32; z: 3i32;} {value: 2i32;} "y" 1 insertField printStack _:;
] "main" exportFunction

Expected Output During Compilation

{
  x: 1;
  y: 2;
  z: 3;
}

removeField

"objectTools" use
"control" use

{} () {} [
  {x: 1i32; y: 2i32; z: 3i32;} 1 removeField printStack _:;
] "main" exportFunction

Expected Output During Compilation

{
  x: 1;
  z: 3;
}

Runtime field rewrite check

"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

Expected Output

TRUE
TRUE

See also