Skip to main content

Iteration Abstraction in Sather

Stephan Murer‚ Stephen M. Omohundro‚ David Stoutamire and Clemens A. Szyperski

Abstract

Sather extends the notion of an iterator in a powerful new way. We argue that iteration abstractions belong in class interfaces on an equal footing with routines. Sather iterators were derived from CLU iterators but are much more flexible and better suited for object-oriented programming. We retain the property that iterators are structured, i.e., strictly bound to a controlling structured statement. We motivate and describe the construct along with several simple examples. We compare it with iteration based on CLU iterators, cursors, riders, streams, series, generators, coroutines, blocks, closures, and lambda expressions. Finally, we describe experiences with iterators in the Sather compiler and libraries.

Journal
ACM Trans. Program. Lang. Syst.
Month
Jan
Number
1
Pages
1−15
Volume
18
Year
1996