In _Anatomy of LISP_, John Allen introduces continuations in Chapter 4, Imperative Constructs in LISP, section 4.7, `eval’ with Explicit Control.
This helped me a lot to understand continuations back when I first read that book.
He writes:
«We now propose to explicitly *pass along* information about what to do after the current computation is completed.
This information is called the *continuation*.»
In the implementation shown, a continuation is a function supplied as the sole parameter `c’ of function `ceval’, the evaluator; `c’ is also a non-local variable in auxiliary function `ev1’.
The whole evaluation algorithm works with a tad of higher-order mutually recursive wizardry.
Note: the bibliography includes two items related to the handling of non-local variables in the latter, though the book doesn't have explicit references to the first one.
Moses, J., ‘The Function of FUNCTION in LISP’, _SIGSAM Bulletin_, p. 13–27, July 1970.
Weizenbaum, J., ‘The FUNARG Problem Explained’, unpublished memorandum, M.I.T., Cambridge, Mass., 1968.
***
This book was published in 1978.
The algorithms in it are presented in the language of M-expressions (in my view, it is a purely algorithmic language, as distinct from a programming language).
Drawing a weak analogy, to me the exposition evokes texts on differential and integral calculus from the age of Leibniz, Newton, and Euler, before the transformations by Cauchy, Weierstrass, and others.
«About the Author
JOHN R. ALLEN is a member of the technical staff of the Hewlett-Packard Research Lab, Palo Alto, California.
After graduating from Michigan Technical University, he earned an M.A. degree from the University of California at Santa Barbara.
Mr. Allen did graduate work in computer science at Stanford University, where he was later a research associate.
He has taught at the University of California at Los Angeles and Santa Cruz, and at San Jose State.»
#ComputerProgramming
#ComputerScience
#Continuations
#Lisp