Next: , Up: Syntax

3.1.1 Basics 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. 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:

Carriage return
Literal "\"
Literal "
Form feed
ASCII character, represented in octal
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).

Regular expressions are also built-into the language syntax as of 1.0.1. Regular expressions begin with "r/" and end with either "/" (case-sensitive) or "/i" (case-insensitive). This is equivalent to creating a new System.regex object with the appropriate parameters.