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<qualified.TypeName>
Array<Array>
Enumqualified.TypeName.CaseName
Struct<qualified.TypeName>
Null literalnull

Objects do not print addresses or field contents. Struct and enum printing does not box values. Import aliases do not change their qualified output names.

Narrow nullable references before passing them to non-null output overloads. 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.