Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Literals

Tundra supports the following literal types:

TypeExampleNotes
Integer12364-bit signed
Float3.14IEEE-754 double precision
String"hello\n"Double quotes; \n, \\", \\t escapes
Char'a'Single quotes
Booleantrue, falseKeywords
None/nullnoneRepresents absence of value
Array[1, 2, 3]List literal; optional newlines inside
var x = 24
print(x)          # integer

var y = 12.21
print(y)          # float

y = "hi"
print(y)          # string 

print('z')        # char literal

print(true)       # boolean

print(none)       # none

var a =[1,2,3]    # array
print(a[0])

Arrays may span multiple lines

var a = [
    1,
    2,
    1111
]