run-limit

The run exceeded one of the limits that keep a program from running forever.

run error, shown by synod run.

The limits are 100000 steps at one instant of simulated time, a call depth of 500, and 1000000 items in a list or in a text. A phrase that calls itself without an end, or a timer that fires at the same instant again and again (time.Every 0s), hits one of them. The message says which.

Example

Run this program to see the diagnostic.

# package main
use example.com/explain/p

define main
  p.Down
# package p
define Down
  Down

Diagnostic

failed at 0s: p/p.synod:3:3: error[run-limit]: more than 500 nested calls

Fix

Let the call end, here by taking a count that runs out.

# package main
use example.com/explain/p

define main
  p.Down 3
# package p
define Down [n: number]
  if (n more than 0)
    Down (n minus 1)