Next: , Up: Syntax


3.1.1 Basics

3.1.1.1 General

All statements in Kite end with a semicolon. For instance:

     "Hello world"|print;

Whitespace also does not matter, for the most part. "hello world" | print ; is equivalent to the first line above. Brackets are used to delineate blocks.

3.1.1.2 Representation of Built-In Types

Numbers are represented as in other languages (integers have no periods, while floating-point numbers have one). Strings are surrounded by double quotes, and have the normal escapes:

\n
Newline
\r
Carriage return
\\
Literal "\"
\"
Literal "
\t
Tab
\b
Backspace
\f
Form feed
\[0-7][0-7]?[0-7]?
ASCII character, represented in octal
\x[0-F][0-F]?
ASCII character, represented in hexadecimal

Strings can also span multiple lines without the need for any escape character. Lists are surrounded by [ and ] characters, with each element separated by commas: [1,2,3]. All built-in types are immutable, except for lists. Boolean values are true and false (for true and false, respectively).

As of 1.0b8, it's also possible to specify a range of integers by using the following construct: from:to(:step). This will instantiate a System.math.range object (see kdoc documentation) that represents all the numbers from one integer to another (possibly skipping numbers along the way).