Next: Synchronous sequences, Previous: Main looping macros, Up: Macros for writing loops
For lists, vectors, & strings, the elt-var is bound to the successive elements of the list or vector, or the successive characters of the string.
For
count*, the elt-var is bound to the elements of the sequencestart, start + step, start + 2*step, ..., end, inclusive of start and exclusive of end. The default step is1, and the sequence does not terminate if no end is given or if there is no N > 0 such that end = start + Nstep. (=is used to test for termination.) For example,(count* i 0 -1)does not terminate because it begins past the end value, and(count* i 0 1 2)does not terminate because it skips over the end value.For
input*, the elements are the results of successive applications of reader-proc to input-port. The sequence ends when the reader-proc returns an end-of-file object, i.e. a value that satisfieseof-object?.For
stream*, the proc receives the current seed as an argument and must return two values, the next value of the sequence & the next seed. If the new seed is#f, then the previous element was the last one. For example,(list* elt list)is the same as(stream* elt (lambda (list) (if (null? list) (values 'ignored #f) (values (car list) (cdr list)))) list)