Language
Variables & Control Flow
Variables
summon x = 10 // declare
x = 20 // reassign (must already exist)
forget x // remove from scope
summon declares in the current scope; bare name = expr reassigns an existing binding (walking outward through enclosing scopes); forget deletes it. Assigning or forgetting an undefined name is a runtime error.
Conditionals
Use when … -> with optional chained when branches and a final otherwise:
when score > 90 -> proclaim "A"
when score > 80 -> proclaim "B"
otherwise -> proclaim "C"
A branch body is either a single statement after -> or a { } block. If a condition divines to an oracle value it is treated as false (with a whisper).
Loops
while x > 0 { x = x - 1 }
repeat 3 { proclaim "again" }
repeat forever {
summon line = ask "> "
when line == "stop" -> break
}
for item in [1, 2, 3] { proclaim item }
for key in {a: 1, b: 2} { proclaim key } // a, b
for … in iterates a list (or a map's keys). break and continue work in all three loop forms.