Common Lisp the Language, 2nd Edition

Next: Introduction Up: Common Lisp the Language Previous: Identity Function

# 26. Loop

By Jon L White

`PREFACE:` X3J13 voted in January 1989 (LOOP-FACILITY) to adopt an extended definition of the `loop` macro as a part of the forthcoming draft Common Lisp standard.

This chapter presents the bulk of the Common Lisp Loop Facility proposal, written by Jon L White. I have edited it only very lightly to conform to the overall style of this book and have inserted a small number of bracketed remarks, identified by the initials GLS. (See the Acknowledgments to this second edition for acknowledgments to others who contributed to the Loop Facility proposal.)

> - Guy L. Steele Jr.

- Introduction
- How the Loop Facility Works
- Parsing Loop Clauses
  - Order of Execution
  - Kinds of Loop Clauses
  - Loop Syntax
- User Extensibility
- Loop Constructs
- Iteration Control
- End-Test Control
- Value Accumulation
- Variable Initializations
- Conditional Execution
- Unconditional Execution
- Miscellaneous Features
  - Data Types
  - Destructuring