Skip to content

Simultaneous Updates

All right-hand sides read the current row, and all primed values commit together. The order of the assignments therefore does not matter, and two variables are enough to step through the Fibonacci numbers.

def fib(n: num) -> num:
init: i = 0; a = 0; b = 1
while i < n:
a' = b
b' = a + b
i' = i + 1
return a
print(fib(10))
Run in playground
Output
55