You are looking at historical revision 3802 of this page. It may
differ significantly from its current revision. LOOP is a
generalized iteration form supporting extensible iterator
macros, keyword updates, and full recursion. The idea is to
create a loop as simple and close to natural Scheme as possible,
while still being extensible. See the article with message-id
<email@example.com> posted on comp.lang.scheme in September of
2006 for the original version and a brief history of Lisp
iteration constructs. In its most basic usage, LOOP can be used
as a drop-in replacement for named let (assuming the let name
isn't passed as a first class value). So, for example, the
following definitions (define (fold kons knil ls) (let lp ((ls
ls) (knil knil)) (if (pair? ls) (lp (cdr ls) (kons (car ls)
knil)) knil))) (define (fold kons knil ls) (loop lp ((ls ls)
(knil knil)) (if (pair? ls) (lp (cdr ls) (kons (car ls) knil))
knil))) are equivalent. We further allow automatic stepping of
variables, as in the DO macro: (define (