1.1 About the Loop Facility
loop
macro. For the sake of convenience, references to theloop
macro that follow denote theloop
macro as part of the Loop Facility, not the Common Lisploop
macro. In discussions that concern the macro itself and not an extended construct,loop
appears in boldface. The evaluation of theloop
macro occurs first through macro expansion. When Lisp encounters aloop
macro call form, it invokes the Loop Facility and passes to it the loop clauses as a list of unevaluated forms, as with any macro. The loop clauses contain Common Lisp forms and loop keywords. The loop keywords are recognized by their symbol name, regardless of the packages that contain them. Theloop
macro translates the given form into Common Lisp code and returns the expanded form.
The expanded loop form is one or more lambda expressions for the local binding of loop variables and a block and a tagbody that express a looping control structure. The expanded form consists of three basic parts in the tagbody:
Expansion of theloop
macro produces an implicit block (namednil
). Thus, the Common Lisp macroreturn
and the special formreturn-from
can be used to return values from a loop or to exit a loop.
Generated with Harlequin WebMaker