Lazy and Delayed Evaluation

Laziness refers to the delay in the evaluation of an expression until it’s required. In many of Clojure’s evaluation algorithms, data structures are abstracted as logical lists or sequences. Sequencing enables the lazy evaluation of the sequence’s elements, realizing performance gains in many circumstances and allowing for the creation of infinite lists.

Peter Henderson and James H. Morris, Jr. introduced A Lazy Evaluator [HM76][80] to Lisp in 1976, building on the call-by-need mechanism introduced by Wadsworth in Semantics and Pragmatics of the Lambda-calculus [Wad71] and the delay rule as presented by Jean Vuillemin in Correct and Optimal Implementations of Recursion in a Simple Programming Language [Vui73].

Get Clojure Applied now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.