Import std.core.format
std.core.format
Formatting by a template that the program has only when it runs: Format, whose fields take interpolation's specs, which the runtime splits; and the debug form, "{x:?}", which the compiler makes for every type, and Dump.
std/core/format.fb
Types
DebugElements
attribute
Public Attribute DebugElements
On an Iterable type, makes its debug form show its elements in place of its Fields, as
"Stack<Int32> [1, 2]".
DebugEntries
attribute
Public Attribute DebugEntries
On an Iterable type of (key, value) tuples, makes its debug form show them as a Map's, as
"Map<String, Int32> {"a": 1}".
Functions
Format
function
Public Function Format(template: String, values: Formattable...): String Throws FormatError
template with its fields filled: "{}" is the next value, "{0}" the first, and either can
take a format spec after a ':', as "{0:>8}" or "{:.2}" does, or else shows its value as "{x}"
does; "{{" and "}}" are braces. In source, a template is a raw string, r"{} of {}", whose
braces aren't interpolations. Throws a FormatError for a template that isn't one, a field
whose value isn't given, or a spec that its value doesn't take.
Dump
function
Public Function Dump<T>(value: T): String
The debug form of value, with each part on a line of its own, as "{value:#?}" gives it.
Report an issue with this page or with FutureBlitz on GitHub.