Книга: Practical Common Lisp
Putting It All Together
Putting It All Together
Now you've seen all the main features of the LOOP
facility. You can combine any of the clauses I've discussed as long as you abide by the following rules:
• The named
clause, if any, must be the first clause.
• After the named
clause come all the initially
, with
, for
, and repeat
clauses.
• Then comes the body clauses: conditional and unconditional execution, accumulation, and termination test.[244]
• End with any finally
clauses.
The LOOP
macro will expand into code that performs the following actions:
• Initializes all local loop variables as declared with with
or for
clauses as well as those implicitly created by accumulation clauses. The initial value forms are evaluated in the order the clauses appear in the loop.
• Execute the forms provided by any initially
clauses—the prologue—in the order they appear in the loop.
• Iterate, executing the body of the loop as described in the next paragraph.
• Execute the forms provided by any finally
clauses—the epilogue—in the order they appear in the loop.
While the loop is iterating, the body is executed by first stepping any iteration control variables and then executing any conditional or unconditional execution, accumulation, or termination test clauses in the order they appear in the loop code. If any of the clauses in the loop body terminate the loop, the rest of the body is skipped and the loop returns, possibly after running the epilogue.
And that's pretty much all there is to it.[245] You'll use LOOP
fairly often in the code later in this book, so it's worth having some knowledge of it. Beyond that, it's up to you how much you use it.
And with that, you're ready to dive into the practical chapters that make up the rest of the book—up first, writing a spam filter.
- 16.4. Putting It All Together
- Unconditional Execution
- Wiring It Together
- Chapter 5 Installing and Configuring VirtualCenter 2.0
- Chapter 13. rc.firewall file
- 3.2.1.2. Начальное выделение памяти: malloc()
- Installation on Red Hat 7.1
- example rc.firewall
- explanation of rc.firewall
- rc.firewall.txt script structure
- rc.firewall.txt
- rc.DMZ.firewall.txt