developerWorks: Lazy Programming and Lazy Evaluation | Linux Today

developerWorks: Lazy Programming and Lazy Evaluation

Written By
Web Webster
Web Webster
Dec 21, 2006

[ Thanks to An Anonymous Reader for
this link. ]

“Lazy programming is a technique that lets you delay the
evaluation of code until you need the resulting value. In Scheme,
for example, lazy programming is explicitly supported through two
special constructs. Scheme’s delay special form takes a block of
code and, rather than executing it, stores the code and its
parameters as a promise. If you force the promise to produce a
value, it will then run the code. The promise then saves the
result, so that future requests for the value will be returned
instantly without having to execute the code again.

“Here is a simple example of how delay and force work
together…”


Complete Story

Web Webster

Web Webster

Web Webster has more than 20 years of writing and editorial experience in the tech sector. He’s written and edited news, demand generation, user-focused, and thought leadership content for business software solutions, consumer tech, and Linux Today, he edits and writes for a portfolio of tech industry news and analysis websites including webopedia.com, and DatabaseJournal.com.

Linux Today Logo

LinuxToday is a trusted, contributor-driven news resource supporting all types of Linux users. Our thriving international community engages with us through social media and frequent content contributions aimed at solving problems ranging from personal computing to enterprise-level IT operations. LinuxToday serves as a home for a community that struggles to find comparable information elsewhere on the web.

Property of TechnologyAdvice. © 2026 TechnologyAdvice. All Rights Reserved

Advertiser Disclosure: Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.