Appendix B Common Lisp Compatibility

The following is a list of some of the most important incompatibilities between this package and Common Lisp as documented in Steele (2nd edition).

The word cl-defun is required instead of defun in order to use extended Common Lisp argument lists in a function. Likewise, cl-defmacro and cl-function are versions of those forms which understand full-featured argument lists. The &whole keyword does not work in cl-defmacro argument lists (except inside recursive argument lists).

The equal predicate does not distinguish between IEEE floating-point plus and minus zero. The cl-equalp predicate has several differences with Common Lisp; see Predicates.

The cl-do-all-symbols form is the same as cl-do-symbols with no obarray argument. In Common Lisp, this form would iterate over all symbols in all packages. Since Emacs obarrays are not a first-class package mechanism, there is no way for cl-do-all-symbols to locate any but the default obarray.

The cl-loop macro is complete except that loop-finish and type specifiers are unimplemented.

The multiple-value return facility treats lists as multiple values, since Emacs Lisp cannot support multiple return values directly. The macros will be compatible with Common Lisp if cl-values or cl-values-list is always used to return to a cl-multiple-value-bind or other multiple-value receiver; if cl-values is used without cl-multiple-value-… or vice-versa the effect will be different from Common Lisp.

Many Common Lisp declarations are ignored, and others match the Common Lisp standard in concept but not in detail. For example, local special declarations, which are purely advisory in Emacs Lisp, do not rigorously obey the scoping rules set down in Steele’s book.

The variable cl--gensym-counter starts out with zero.

The cl-defstruct facility is compatible, except that the :type slot option is ignored.

The second argument of cl-check-type is treated differently.