Special operators are forms that are neither functions, nor macros. They provide lower-level building blocks for the rest of the functions and macros.
In Common Lisp, there are 25 special operators.
Manipulating the Lexical Environment
labels: similar to
letbut define functions.
fletnames can only be references in the body, but
labelsnames can be references immediately within
function: gets function object (reader macro:
Local Flow of Control
return-from: return from a block/function immediately
return-fromwork correctly across function boundaries unwinding the stack. (The
blocklabel is lexically scoped, not dynamically.)
important note: the labels have dynamic extent—you cannot
return-froma block that is no longer on a stack.
go: low-level goto construct
goalso work across function boundaries unwinding the stack as needed
Unwinding the Stack
throw: are dynamic counterparts of
mostly unused because of condition system
unwind-protect: ensure some code is always executed if stack is unwinding
(unwind-protect protected-form cleanup-form*)
multiple-value-call(see Common Lisp: multiple values)
;; Basic form: (eval-when (situation*) body-form*)