SplitScript reference / Debug

Debug

capability

capability Debug

Produces an unambiguous structural representation of a value.

String and char values are quoted and escaped. Source records and enums derive a multiline representation recursively when every contained value implements Debug. Standard-library containers opt into the same conditional derivation for their element or payload types.

Every Debug value also implements Display. A custom Display.toString remains the user-facing representation, while Debug.debugString controls how a value appears inside another derived value.

Examples

Preserve quotes around nested text

let checkpoints = ["forest", "castle"]
print(checkpoints)

Requires

MemberDescriptionAvailable through
DisplaySupports conversion to a user-facing textual representation.

Implemented by

MemberDescriptionAvailable through
FileVersionA four-part numeric Windows executable version.
NoneStores the single unit value None.
StringStores ordinary immutable UTF-8 text in WebAssembly GC memory.
addressStores a process address.
boolStores a boolean value.
charStores one Unicode scalar value.
f32Stores a 32-bit floating-point number.
f64Stores a 64-bit floating-point number.
i16Stores a 16-bit signed integer.
i32Stores a 32-bit signed integer.
i64Stores a 64-bit signed integer.
i8Stores an 8-bit signed integer.
u16Stores a 16-bit unsigned integer.
u32Stores a 32-bit unsigned integer.
u64Stores a 64-bit unsigned integer.
u8Stores an 8-bit unsigned integer.

Methods

MemberDescriptionAvailable through
debugStringConverts the receiver to its unambiguous structural representation.