Next: Examples, Previous: Sequence types, Up: Macros for writing loops
When using the sequence types described above, a loop terminates when any of its sequences terminate. To help detect bugs, it is useful to also have sequence types that check whether two or more sequences end on the same iteration. For this purpose, there is a second set of sequence types called synchronous sequences. Synchronous sequences are like ordinary asynchronous sequences in every respect except that they cause an error to be signalled if a loop is terminated by a synchronous sequence and some other synchronous sequence did not reach its end on the same iteration.
Sequences are checked for termination in order from left to right, and if a loop is terminated by an asynchronous sequence no further checking is done.
These are all identical to their asynchronous equivalents above, except that they are synchronous. Note that
count%
's end argument is required, unlikecount*
's, because it would be nonsensical to check for termination of a sequence that does not terminate.