Tekst
Source
Documentation/Language Referencesource tree
Reference

Language Reference

A compact index of the syntax supported by the current native compiler.

Values

ValueExample
Integer42
Float3.14
Booleantrue
String"Tekst"
NoneNone
List[1, 2, 3]
Tuple(1, 2)
Dictionary{"name": "Tekst"}

Statements

SyntaxPurpose
if / elif / elseConditional execution
whileConditional loop
for ... inIteration
try / catchHandle runtime errors
fnFunction and method declaration
classClass declaration
use moduleLoad a module
from module use nameLoad a selected name
import / from ... importLegacy module syntax, retained for compatibility
returnReturn a value from a function

To handle a runtime failure, put the operation in a try: block and follow it with a catch: block. See Error Handling for examples.

Built-ins

Built-inPurpose
printWrite output
inputRead input
intConvert to integer
floatConvert to float
strConvert to string
boolConvert to boolean
lenGet length
rangeCreate a numeric range for iteration

Operators

Arithmetic uses +, -, *, /, and %. Comparisons use ==, !=, <, <=, >, and >=. Logical expressions use and and or.

Pointers

&x, *p, alloc, free, load_int, store_int, load_byte, and store_byte expose the explicit memory layer.