next up previous
Next: 9 Handling of built-in Up: Differences between Sather-1.0 and Previous: 7 Arrays

8 Iterators/Streams


Where S1 has iterators, SK has streams. In both languages these can be bound like routines and are then called iterator closures or bound streams respectively. SK distinguishes between direct stream calls and calls of a stream object. The former behaves like S1 iterators. The latter factors S1 iterators into the creation of a stream object (partial stream call) and the use of the stream object (application of the ! operator). The essential difference is that in SK, stream state need not end when a loop terminates (it may be resumed in another loop) and the termination status may be checked.