Language reference
The reference describes the syntax and behavior you can use in Cloth programs. Begin with the tutorials if you are new to the language.
Types covers primitives, strings, arrays, objects, enums,
structs, and void. Language rules covers declarations,
functions, control flow, classes, interfaces, conversions, and memory.
For building and organizing projects, use Tools and projects.
Core conventions
- Source files end in
.coand define one type named by the file stem. - Packages come from source directories; source files have no
moduledeclaration. - Identifiers are case-sensitive; uppercase declaration names are public.
- References are non-null unless qualified with
?. int,uint, andfloatalways meanint32,uint32, andfloat32.- Statements use semicolons; function and control-flow bodies use braces.
Examples that intentionally show invalid code are labeled as such.