Skip to Content
Cloth

Printing

The core functions print(value) and println(value) write one value. println adds one line-feed byte; println() writes only that line feed.

print("Count: "); println(3); println();

Output:

Count: 3

Neither function inserts spaces, accepts multiple arguments, or interprets format placeholders. They return void. A local or member named print or println shadows the corresponding core overload set.

Value representations

ValuePrinted form
StringIts UTF-8 bytes unchanged
Booleantrue or false
CharacterUnicode scalar encoded as UTF-8
IntegerBase-10 digits, with a minus sign when negative
Finite floating-pointLocale-independent shortest round-trippable decimal
Special floating-pointinf, -inf, or nan
Class instance through objectIts virtual ToString() result
Array<Array>
Enumqualified.TypeName.CaseName
Struct value<qualified.TypeName>
Boxed structqualified.TypeName{Field=value, ...}
Null literalnull

The default class representation is <qualified.TypeName> and contains no address or hash. A class may override ToString(). Direct struct and enum printing does not box values. Import aliases do not change qualified output names.

Nullable object output prints null when absent and dynamically formats a present value. The bare null literal has its own output support.

String bytes, including embedded zero bytes, are preserved. Native Windows output uses the same line-feed contract as other supported hosts.

User-defined string conversion, interpolation, array-content formatting, and general formatting APIs are not currently supported. For text concatenation, both operands of + must be strings.