In Common Lisp, a special form is a Lisp expression that looks like a function call, i.e., has the form (function-name ...), but is, in fact, treated specially by the Lisp interpreter.
Function calls always work the same way:
Special forms, on the other hand, have no such regular pattern of behavior. Here are some examples of special forms that violate the above rules:
(quote a)a is not evaluated.(if (> x y) a b)x or y is larger, either the second or third
argument will not be evaluated.(let ((x 10)) (* x x))let is able to refer to and modify
x itself, not just the value of x.(defun foo (x) (+ x 1))defun are evaluated. In
fact, neither the function name, foo, nor the parameter
list, (x), should ever be evaluated.Common Lisp comes with a predefined set of special functions,
including and, cond, defun,
let, or, and so on.
You can't define your own special functions, but you can do something almost as good, using macros.
Comments?
Send mail to Chris Riesbeck.