Efficient high-level iteration with accumulators

2Citations
Citations of this article
5Readers
Mendeley users who have this article in their library.

Abstract

Accumulators are proposed as a new type of high-level iteration construct for imperative languages. Accumulators are user-programmed mechanisms for successively combining a sequence of values into a single result value. The accumulated result can either be a simple numeric value such as the sum of a series or a data structure such as a list. Accumulators naturally complement constructs that allow iteration through user-programmed sequences of values such as the iterators of CLU and the generators of Alphard. A practical design for high-level iteration is illustrated by way of an extension to Modula-2 called Modula Plus. The extension incorporates both a redesigned mechanism for iterators as well as the accumulator design. Several applications are illustrated including both numeric and data structure accumulation. It is shown that the design supports efficient iteration both because it is amenable to implementation via in-line coding and because it allows high-level iteration concepts to be implemented as encapsulations of efficient low-level manipulations. © 1989, ACM. All rights reserved.

Cite

CITATION STYLE

APA

Cameron, R. D. (1989). Efficient high-level iteration with accumulators. ACM Transactions on Programming Languages and Systems (TOPLAS), 11(2), 194–211. https://doi.org/10.1145/63264.63401

Register to see more suggestions

Mendeley helps you to discover research relevant for your work.

Already have an account?

Save time finding and organizing research with Mendeley

Sign up for free