Syntax

  • Whitespace is signifiant, indentation uses either tabs or exactly 4 spaces
  • Flow control statements, enums, classes and functions require indentation
  • Lesma's Checker will report any invalid syntax or unrecommended behaviour, such incompatible types for operations, or unused variables.
  • _ variable name is used as an ignored result, and is treated differently by the compiler (similar to golang)
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
def do_that()
    pass

if true
    do_that()
else if false
    if true
        pass
    do_that()
else
    do_that()

for _ in 0..20
    do_that()

while(false)
    do_that()

class Example
    x: int
    new(x: int)
        self.x = x