The information in this section describes some of the ways that SBCL deals with choices that the ANSI standard leaves to the implementation.
Declarations are generally treated as assertions. This general principle, and its implications, and the bugs which still keep the compiler from quite satisfying this principle, are discussed in the chapter on the compiler.
SBCL is essentially a compiler-only implementation of Common Lisp. That is, for all but a few special cases, eval creates a lambda expression, calls compile on the lambda expression to create a compiled function, and then calls funcall on the resulting function object. This is explicitly allowed by the ANSI standard, but leads to some oddities, e.g. collapsing functionp and compiled-function-p into the same predicate.
SBCL is quite strict about ANSI's definition of defconstant. ANSI says that doing defconstant of the same symbol more than once is undefined unless the new value is eql to the old value. Conforming to this specification is a nuisance when the "constant" value is only constant under some weaker test like string= or equal. It's especially annoying because, in SBCL, defconstant takes effect not only at load time but also at compile time, so that just compiling and loading reasonable code like
(defconstant +foobyte+ '(1 4))runs into this undefined behavior. Many implementations of Common Lisp try to help the programmer around this annoyance by silently accepting the undefined code and trying to do what the programmer probably meant. SBCL instead treats the undefined behavior as an error. Often such code can be rewritten in portable ANSI Common Lisp which has the desired behavior. E.g., the code above can be given an exactly defined meaning by replacing defconstant either with defparameter or with a customized macro which does the right thing, possibly along the lines of the defconstant-eqx macro used internally in the implementation of SBCL itself. In circumstances where this is not appropriate, the programmer can handle the condition type sb-ext:defconstant-uneql, and choose either the continue or abort restart as appropriate.
SBCL gives style warnings about various kinds of perfectly legal code, e.g.
defmethod without defgeneric
multiple defuns of the same symbol
special variables not named in the conventional *foo* style, and lexical variables unconventionally named in the *foo* style