Each of the special forms in this section simply evaluates its arguments in left-to-right order. The only difference is the result returned.
The most widely used sequencing special form is
evaluates all its argument forms and returns the computed value of the last
one. Many other control structures are said to perform an implicit progn,
this means that internally they call
progn with a list of forms.
progn in Lisp is nearly analogous to a
block in Pascal; it is used in much the same places—to allow you to
evaluate a sequence of form where only one form was allowed (for
example the “true” clause of an
All of the forms are evaluated sequentially (from left-to-right),
the result of the last evaluated form is the return value of the
special form. If no arguments are given to
progn it returns
(progn 'one (+ 1 1) "three") ⇒ "three" (progn) ⇒ ()
This special form evaluates its first form then performs an implicit progn on the rest of its arguments. The result of this structure is the computed value of the first form.
(prog1 'one (+ 1 1) "three") ⇒ one
This is similar to
prog1 except that the evaluation of its
second form is returned.
The first form is evaluated, then its second, then it performs an implicit progn on the remaining arguments.
(prog2 'one (+ 1 1) "three") ⇒ 2