An :up-to option would start the given state var, and all state vars with a lower order number (starting with the lowest). Or it would stop the given state var, and all state vars with a higher order (starting with the highest).
This composes well with the :except option and :substitute option. Not so much with the :only option, though.
Of course, a convenience/API function called up-to can be supplied.
Example:
(defstate a :start nil)
(defstate b :start nil)
(defstate c :start nil)
(start (up-to #'b))
;=> (#'user/a #'user/b)
(start)
;=> (#'user/c)
(stop (up-to #'b))
;=> (#'user/c #'user/b)
An
:up-to
option would start the given state var, and all state vars with a lower order number (starting with the lowest). Or it would stop the given state var, and all state vars with a higher order (starting with the highest).This composes well with the
:except
option and:substitute
option. Not so much with the:only
option, though.Of course, a convenience/API function called
up-to
can be supplied.Example: