Control Flow

Expressive control structures for decision making and iteration.

Conditionals (foresee)

KEIKAKU Protocol
1foresee x > 10:
2 declare("Warning")
3alternate x > 5:
4 declare("Notice")
5otherwise:
6 declare("Info")

Iteration (cycle)

While

KEIKAKU Protocol
1cycle while condition:
2 # do something

For each loop

KEIKAKU Protocol
1items := [1, 2, 3]
2cycle through items as item:
3 declare(item)

Range loop

KEIKAKU Protocol
1cycle from 1 to 5 as i:
2 declare(i) # 1, 2, 3, 4

Special Constructs

KEIKAKU Protocol
1# Deferred execution block
2scheme:
3 # code here
4execute
5
6# Assertion
7absolute value > 0