setq
and sequencing is specified by the special operator progn
.
setq
, which looks like this:
(setq
identifer
expression)
The expression is evaluated and identifier is updated
with the result. The result of the setq
expression is the value
of expression. Here are some examples:
DEBUG> top:
ticks-per-second
to 4
... not a good idea in
general! We can also try to update nil
, however, this is not
permitted.
progn
and is equivalent to Pascal's
begin
... end
or C's
{
... }
. It looks like this:
(progn
exp-1 ...
exp-n)
Each of the expressions exp-1 to exp-n is evaluated
in order. The result of progn
is
exp-n.
The most common occurrence of progn
is in the consequent
or alternative branches of an if
expression. Note that it is
not needed in cond
expressions, since the consequent in each
case, can be a sequence of expressions.