Expressional loops

This paper proposes an expressional loop notation (XLoop) based on the ideas described in [16,17] which makes it practical to express loops as compositions of functions. The primary benefit of XLoop is that it brings the powerful metaphor of expressions and decomposability to bear on the domain of loops. Wherever this metaphor can be applied, it makes algorithms much easier to construct, understand, and modify. XLoop applies the expressional metaphor to loops by introducing a new data type series. A series is an ordered one dimensional sequence of data objects. Series are used to represent intermediate results during a computation. Algorithms which would typically be rendered as iterative loops are instead represented as compositions of functions operating on series. For example, the program SUM_VECT computes the sum of the elements in a vector of integers by using ENUM_VECTOR to create a series of the integers in the vector and then using SUM to compute their sum.