Common LISP: the language
Back to direct style II: first-class continuations
LFP '92 Proceedings of the 1992 ACM conference on LISP and functional programming
Warm fusion: deriving build-catas from recursive definitions
FPCA '95 Proceedings of the seventh international conference on Functional programming languages and computer architecture
Dependent types in practical programming
Proceedings of the 26th ACM SIGPLAN-SIGACT symposium on Principles of programming languages
From recursion to iteration: what are the optimizations?
PEPM '00 Proceedings of the 2000 ACM SIGPLAN workshop on Partial evaluation and semantics-based program manipulation
Implementation Strategies for First-Class Continuations
Higher-Order and Symbolic Computation
A Comparative Revisitation of Some Program Transformation Techniques
Selected Papers from the Internaltional Seminar on Partial Evaluation
ACM '77 Proceedings of the 1977 annual conference
Tools and libraries to model and manipulate circular programs
Proceedings of the 2007 ACM SIGPLAN symposium on Partial evaluation and semantics-based program manipulation
A shortcut fusion rule for circular program calculation
Haskell '07 Proceedings of the ACM SIGPLAN workshop on Haskell workshop
Swapping arguments and results of recursive functions
MPC'06 Proceedings of the 8th international conference on Mathematics of Program Construction
Shortcut fusion rules for the derivation of circular and higher-order programs
Higher-Order and Symbolic Computation
Hi-index | 0.00 |
We present a programming pattern where a recursive function traverses a data structure---typically a list---at return time. The idea is that the recursive calls get us there (typically to a base case) and the returns get us back again while traversing the data structure. We name this programming pattern of traversing a data structure at return time "There And Back Again" (TABA).The TABA pattern directly applies to computing a symbolic convolution. It also synergizes well with other programming patterns, e.g., dynamic programming and traversing a list at double speed. We illustrate TABA and dynamic programming with Catalan numbers. We illustrate TABA and traversing a list at double speed with palindromes and we obtain a novel solution to this traditional exercise.A TABA-based function written in direct style makes full use of an Algol-like control stack and needs no heap allocation. Conversely, in a TABA-based function written in continuation-passing style, the continuation acts as a list iterator. In general, the TABA pattern saves one from constructing intermediate lists in reverse order.