Книга: Practical Common Lisp

The Parts of a LOOP

The Parts of a LOOP

You can do the following in a LOOP:

• Step variables numerically and over various data structures

• Collect, count, sum, minimize, and maximize values seen while looping

• Execute arbitrary Lisp expressions

• Decide when to terminate the loop

• Conditionally do any of these

Additionally, LOOP provides syntax for the following:

• Creating local variables for use within the loop

• Specifying arbitrary Lisp expressions to run before and after the loop proper

The basic structure of a LOOP is a set of clauses, each of which begins with a loop keyword.[234] How each clause is parsed by the LOOP macro depends on the keyword. Some of the main keywords, which you saw in Chapter 7, are for, collecting, summing, counting, do, and finally.

Оглавление книги


Генерация: 1.168. Запросов К БД/Cache: 3 / 0
поделиться
Вверх Вниз