Skip to content

5 : Loops

Paulyn edited this page Nov 28, 2025 · 1 revision

5. Loops

LAT supports a single loop type: the when loop, which behaves like a while.


5.1 While Loop (when)

when (condition) ... done

Rules

  • Condition is checked before every loop iteration

  • Loop stops when condition becomes false

Example

nat i = 0

when (i <

5) print(i) i = i + 1 done

5.2 Infinite Loop Example

when (true) print("looping") done

(Use with caution.)


Clone this wiki locally