Abstract
The benefits of programming in a functional style are well known. Algorithms that are expressed as compositions of functions operating on series/vectors/streams of data elements are much easier to understand and modify than equivalent algorithms expressed as loops. Unfortunately, many programmers hesitate to use series expressions. In part, this is due to the fact that series expressions are typically implemented very inefficiently.A portable Common Lisp macro package (called Series) has been implemented that can evaluate a wide class of series expressions very efficiently by transforming them into iterative loops. When using this class of series expressions, programmers can obtain the advantages of expressing computations as series expressions without incurring any runtime overhead.
- [1] A. Aho, J. Hopcraft, and J. Ullman, The Design and Analysis of Computer Algorithms, Addison-Wesley, Reading MA, 1974. Google ScholarDigital Library
- [2] J. Orwant, Support of Obviously Synchronizable Series Expressions in Pascal, MIT/AI/WP-312, September 1988.Google Scholar
- [3] J. Waters, "A Method for Analyzing Loop Programs", IEEE Trans. on Software Engineering, 5(3):237-247, May 1979.Google ScholarDigital Library
- [4] R. Waters, "Using Obviously Synchronizable Series Expressions Instead of Loops" Proc. 1988 International Conference on Computer Languages, 338-346, Miami FL, IEEE Computer Society press, October 1988.Google Scholar
- [5] R. Waters, Optimization of Series Expressions: Part I: User's Manual for the Series Macro Package, MIT/AIM-1083, January 1989.Google Scholar
- [6] R. Waters, Optimization of Series Expressions: Part II: Overview of the Theory and Implementation, MIT/AIM-1083, January 1989. Google ScholarDigital Library
Index Terms
- The Series macro package
Recommendations
Implementation of an iteration macro
This article describes the implementation of a set of iteration macros. These macros are found in the Portable Common Loops (PCL) implementation of the Common Lisp Object System, though they are not dependent on PCL in any way. The macros were designed ...
Inverse macro in Scala
GPCE 2015: Proceedings of the 2015 ACM SIGPLAN International Conference on Generative Programming: Concepts and ExperiencesWe propose a new variant of typed syntactic macro systems named inverse macro, which improves the expressiveness of macro systems. The inverse macro system enables to implement operators with complex side-effects, such as lazy operators and delimited ...
Hygienic macro technology
The fully parenthesized Cambridge Polish syntax of Lisp, originally regarded as a temporary expedient to be replaced by more conventional syntax, possesses a peculiar virtue: A read procedure can parse it without knowing the syntax of any expressions, ...
Comments