We propose an object-oriented (OO) formulation and implementation of lazy/delayed evaluation by reusing and extending an existing linear recursive structure (LRS) framework with the help of the strategy, decorator and factory design patterns. The result is a robust, flexible framework that can handle both infinite and finite lists and to which existing algorithms for finite lists can be applied without modification. The OO techniques used to develop el are effective tools for teaching abstraction and design of data structures.
Dung Zung Nguyen, Stephen B. Wong