2005-06-19 · in Ideas · 110 words

It might be useful to be able to write something like:

INITIAL BOOL happy IS TRUE:
CHECK happy
  SEQ
    a ()
    b ()
    c ()
  die ("Not happy.")

The block would terminate if happy became FALSE, and would execute the die code. This could be murderously difficult to implement, but could be useful for "the spaceship must not go more than 10 degrees from vertical" problems. Simplest would be to enforce that the first argument must be a SEQ, and only check the condition between items in it -- or use another keyword altogether there. This could be trivially rewritten into a state machine with a WHILE containing a big IF and a counter.