CL symbols » Introduction

Welcome to my very ambitious "article".
This is still incomplete and not quite at the level of my vision...

The menu on the left lists the various sections and their pages. Menu items in green denote particularly interesting pages that you should check first. Menu items in red denote stubs that don't yet contain any useful information whatsoever. Those that are neither green nor red have at least some amount of information on them, though not necessarily much.

CL symbols » All standard symbols

The HyperSpec provides a handy list of all symbols on one page, useful for all kinds of research.
Sometimes nothing beats a good old manual exhaustive linear scan...

A machine-readable version of the list is also available.

By the way, don't get intimidated by Common Lisp's 978 symbols count, it's inflated by various factors such as "symbol duplications" and 20 c[ad]r variations.

The following "sparse table" effectively includes and supercedes, among other things, my old "Common Lisp tips" tweets collection.

Sorry, the table below is not really mobile-optimized yet.
(And anyway it'll probably be refactored into something that's not a table.)

Symbol name
Bindings Notes and tips
&allow-other-keys
Lambda list keyword

This disables keyword arguments checking. It's effectively a "subclause" of &key. It can appear in any lambda list that can accept &key. It's often useful in combination with &rest (and &key) to receive arbitrary keyword arguments for the purpose of forwarding them to a function with APPLY.

If a generic-function specifies &allow-other-keys, then none of its methods needs to. This is very convenient for INITIALIZE-INSTANCE and friends, for instance.

&aux
Lambda list keyword

Many effectively treat this as deprecated, though it's still useful in some cases. Most notably in BOA lambda lists, where it can "internally" initialize a slot according to a computation which may involve previous arguments that were supplied or defaulted. It can also conveniently save a level of indentation compared to using a LET, which is sometimes worthwhile in complex code.

Conceptually, &aux is not part of the public interface of a lambda list.

It's a bit of a shame that &aux can't appear before &key because it could be useful in some cases. Fortunately, such a feature can be emulated like this (contrived example):

(defun slot-value-if-bound
    (object &key ((#:aux boundp) (slot-boundp object 'slot))
              (value (when boundp (slot-value object 'slot))))
  (values value bound))

This is safe because #:aux is an uninterned symbol and thus it's impossible to accidentally supply the keyword argument so the associated default form will always be evaluated to initialize the boundp variable.

One minor inconvenience for the user of such a function is that the argument hints will be cluttered with the fake &aux argument. Support could theoretically be added to tools such as Slime so that they wouldn't show any keyword arguments using an uninterned symbol named "AUX" as keyword-name.

The above is equivalent to the following hypothetical code (that doesn't work):

(defun slot-value-if-bound
    (object &aux (boundp (slot-boundp object 'slot))
     &key (value (when boundp (slot-value object 'slot))))
  (values value boundp))
&body
Lambda list keyword

This is effectively the same as &rest except it requests an indentation of 2 and can only appear in macro lambda lists.

&environment
Lambda list keyword

This is sometimes needed to gain access to the compile-time lexical environment in which a macro call appears for the purpose of forwarding it to functions invoked during macroexpansion which need this information such as (from the HyperSpec) macro-function, get-setf-expansion, compiler-macro-function or macroexpand.

&key
Lambda list keyword

Processing of &key arguments is generally slower than for other kinds of arguments, due to somewhat more complex processing most of which may well happen at runtime, but unless you're dealing with performance-critical code there usually isn't cause for concern.

Use &allow-other-keys to disable keyword arguments checking from the callee side.

My nomination for "weirdest Common Lisp feature": the caller can always disable keyword arguments checking in any &key arguments context by passing :allow-other-keys t. It's sometimes convenient to use this feature to capture a few arguments explicitly and then forward the rest to another function with apply, sidestepping the need to explicitly remove unwanted keyword arguments from the list.

Use &rest to capture a list of all keyword arguments in the order they appear in the call.

&optional
Lambda list keyword

I'd recommend almost always using &key instead of &optional in public interfaces. This is because having several &optional arguments is inconvenient (you might need to explicitly provide several default values just to get at the positional argument you wanted to use) and confusing (the arbitrariness of the order increases exponentially), and thus if many new optional arguments had to be added one would use &key arguments... But then &optional and &key really don't mix well. Indeed only two macros in Common Lisp do so and they have still tripped up many users. So it's generally better to use &key.

&key also makes for more explicit calls, which are arguably easier to read, especially with spotty knowledge of an API.

&rest
Lambda list keyword

Can be used with &key to capture all keyword arguments (even those not known in advance but allowed by &allow-other-keys or :allow-other-keys t) in the order they appear in the call. This order is of particular interest for macros that need to ensure that keyword arguments are evaluated in the same order that the caller intended. This is an often overlooked issue. The easiest way to arrange for a macro to evaluate keyword arguments in the right order is to expand to a function call.

apply is very related.

&whole
Lambda list keyword

The captured macro call form includes the macro operator itself, not just the (unevaluated) arguments.

*
Function

Accepts any number of arguments, including zero.

Variable

lisptip: "A simple REPL"

Primary value only. Use / to get all values.

Type specifier wildcard
**
Variable
***
Variable
*break-on-signals*
Variable
*compile-file-pathname*
Variable

TODO: Mention tip.

*compile-file-truename*
Variable

TODO: Mention tip.

*compile-print*
Variable
*compile-verbose*
Variable
*debug-io*
Variable
*debugger-hook*
Variable
*default-pathname-defaults*
Variable
*error-output*
Variable
*features*
Variable
*gensym-counter*
Variable
*load-pathname*
Variable

Pathname for current .lisp file: #.(or *compile-file-truename* *load-truename*).

This works reliably with load, compile-file, ASDF, Emacs, Slime and .fasl (compiled) files!

*load-print*
Variable
*load-truename*
Variable
*load-verbose*
Variable
*macroexpand-hook*
Variable
*modules*
Variable

ASDF is the de-facto standard replacement for "modules".

*package*
Variable
*print-array*
Variable
*print-base*
Variable
*print-case*
Variable
*print-circle*
Variable
*print-escape*
Variable
*print-gensym*
Variable
*print-length*
Variable
*print-level*
Variable
*print-lines*
Variable
*print-miser-width*
Variable
*print-pprint-dispatch*
Variable
*print-pretty*
Variable
*print-radix*
Variable
*print-readably*
Variable
*print-right-margin*
Variable
*query-io*
Variable
*random-state*
Variable
*read-base*
Variable
*read-default-float-format*
Variable

lisptip: "Reading floats"

*read-eval*
Variable
*read-suppress*
Variable
*readtable*
Variable
*standard-input*
Variable
*standard-output*
Variable

lisptip: "Redirecting output"

*terminal-io*
Variable
*trace-output*
Variable
+
Function

Accepts any number of arguments, including zero:

(+ 1 2 3) → 6
(+) → 0
Variable

lisptip: "Evaluating the last expression" ("#.+")

Method combination type
++
Variable
+++
Variable
-
Function

Accepts one or more arguments. With a single argument, negates the number:

(- 42 2 10) → 30
(- 42) → -42
Variable
/
Function

Accepts one or more arguments. With a single argument, returns the reciprocal of the number:

(/ 32 4 2) → 4
(/ 64) → 1/64

Many programming languages support two kinds of division operations, both of which are imprecise:

Integer division

In many languages, returns an integer result and loses the remainder. For example, dividing 3 by 2 would yield 1 and the remainder of 1 would be lost.

Common Lisp supports this type of division with floor and truncate when using 2 integer arguments (but these functions can do much more).

Floating-point division

Floating-point numbers have many inherent limitations regarding accuracy. For example, the result of dividing 1 by 3 can't be representated accurately using floating-point numbers. The real result is 1/3 or 0.333... but a floating-point representation might yield 0.33333334 as an answer.

Common Lisp supports this type of division. Simply pass floating-point numbers to /:

(/ 1.0 3) → 0.33333334
(Results may vary depending on the kinds of floats the current Common Lisp implementation supports.)

One of the many features that sets Common Lisp apart from other languages is that it supports true fractions directly:

(/ 3 9) → 1/3
(/ 20 15) → 4/3
Variable
//
Variable
///
Variable
/=
Function

Accepts one or more arguments.

1+
Function
(1+ number) == (+ number 1)

incf increments a place.

1-
Function
(1- number) == (- number 1)

decf decrements a place.

<
Function

Accepts one or more arguments.

<=
Function

Accepts one or more arguments.

=
Function

Accepts one or more arguments.

>
Function

Accepts one or more arguments.

>=
Function

Accepts one or more arguments.

abort
Function
(abort) == (invoke-restart 'abort)
(abort condition) == (invoke-restart (find-restart 'abort condition))
Restart
abs
Function
acons
Function
(acons key datum alist) ==  (cons (cons key datum) alist)
acos
Function

The result of either asin or acos can be a complex even if number is not a complex; this occurs when the absolute value of number is greater than one.

acosh
Function
add-method
Generic function

The usual way of adding a method to a generic-function is with defmethod.

adjoin
Function

The modify-macro equivalent is pushnew.

adjust-array
Function

This is a very complex function.

You can't just guess at what it does from the arguments' names. I recommend reading the specification carefully before using it.

adjustable-array-p
Function

Tests whether an array is actually adjustable, which is necessarily the case if it's expressly adjustable and may or may not be the case if it isn't so.

allocate-instance
Generic function
alpha-char-p
Function
alphanumericp
Function
(alphanumericp character)
== (or (alpha-char-p character)
    (not (null (digit-char-p character))))

The results of this predicate are independent of any special syntax which might have been enabled in the current readtable.

and
Macro
Combining type specifier
Method combination type
append
Function

Each [argument] must be a proper list except the last, which may be any object.

All arguments are copied except the last one. The result shares structure with the last argument.

If you need to ensure that all arguments are copied including the last one, use (concatenate 'list ...).

[The result] will be a list unless the last list was not a list and all preceding lists were null.

apply
Function

Yes, this is just a function!

Note that apply accepts any number of arguments to pass to the function (first argument). Only the last argument to apply will be "spread".

This is very convenient and can reduce consing to a minimum in many common use-cases, one of which is overriding keyword parameters:

(lambda (function &rest keys &key (n 1) &allow-other-keys)
  (apply function :n (- n) keys))
==
(lambda (function &rest keys &key (n 1) &allow-other-keys)
  (apply function (list* :n (- n) keys)))

Note that beyond simple cases, apply often prevents many optimizations due to its dynamic nature.

If the number of arguments is known in advance, then funcall usually suffices.

apropos
Function
apropos-list
Function
aref
Accessor
arithmetic-error
Condition type
arithmetic-error-operands
Function
arithmetic-error-operation
Function
array
System class
array-dimension
Function
array-dimension-limit
Constant variable
array-dimensions
Function
array-displacement
Function
array-element-type
Function
array-has-fill-pointer-p
Function
array-in-bounds-p
Function
array-rank
Function
(array-rank array) == (length (array-dimensions array))
array-rank-limit
Constant variable
array-row-major-index
Function
array-total-size
Function
(array-total-size array) == (reduce #'* (array-dimensions array))

If the array is a vector with a fill pointer, the fill pointer is ignored when calculating the array total size.

Since the product of no arguments is one, the array total size of a zero-dimensional array is one.

See also: row-major-aref

array-total-size-limit
Constant variable
arrayp
Function
(arrayp object) ==  (typep object 'array)
ash
Function

ash performs the arithmetic shift operation on the binary representation of integer, which is treated as if it were binary.

Newbies sometimes have difficulty locating this function.
It's basically a superset of "<<" and ">>" in many languages such as C.

asin
Function

The result of either asin or acos can be a complex even if number is not a complex; this occurs when the absolute value of number is greater than one.

asinh
Function
assert
Macro
assoc
Function
assoc-if
Function
assoc-if-not
Function

The standard says it's deprecated but the community decided otherwise.

atan
Function
atanh
Function
atom
Function

Everything that is not a cons is an atom, including nil.

(atom object) == (typep object 'atom) == (not (consp object))
== (not (typep object 'cons)) == (typep object '(not cons))

atom is one of the very few predicate functions in Common Lisp that doesn't follow the usual naming convention for predicates (ending in "p").

Type

atom is not a "perfect dual" to cons because it's just a type so you can't dispatch on it.

Glossary entry
base-char
Type
base-string
Type
bignum
Type

This is specified to be a type, not a class, so you can't portably dispatch on it.

bit
Accessor
(bit bit-array i j k) == (aref (the (array bit) bit-array) i j k)
Type
Glossary entry
bit-and
Function
bit-andc1
Function
bit-andc2
Function
bit-eqv
Function
bit-ior
Function
bit-nand
Function
bit-nor
Function
bit-not
Function
bit-orc1
Function
bit-orc2
Function
bit-vector
System class
bit-vector-p
Function
(bit-vector-p object) == (typep object 'bit-vector)
bit-xor
Function
block
Special operator

Informally, this is the static, lexical counterpart of catch.

block is generally preferable to catch because it's easier to reason about.

Most code definition constructs such as defun are wrapped in an implicit block of the same name as the unit being defined.

Most iteration constructs are wrapped in an implicit (block nil) which you can return from.

boole
Function

I must say I'm puzzled by this function.

boole-1
Constant variable
boole-2
Constant variable
boole-and
Constant variable
boole-andc1
Constant variable
boole-andc2
Constant variable
boole-c1
Constant variable
boole-c2
Constant variable
boole-clr
Constant variable
boole-eqv
Constant variable
boole-ior
Constant variable
boole-nand
Constant variable
boole-nor
Constant variable
boole-orc1
Constant variable
boole-orc2
Constant variable
boole-set
Constant variable
boole-xor
Constant variable
boolean
Type

Conditional operations, such as if, permit the use of generalized booleans, not just booleans; any non-nil value, not just t, counts as true for a generalized boolean. However, as a matter of convention, the symbol t is considered the canonical value to use even for a generalized boolean when no better choice presents itself.

I'm bummed that there isn't a boolean function that converts a generalized boolean to a boolean. :(

both-case-p
Function
boundp
Function

The function bound (sic) determines only whether a symbol has a value in the global environment; any lexical bindings are ignored.

break
Function
broadcast-stream
System class
broadcast-stream-streams
Function
built-in-class
System class
butlast
Function
(butlast list n) == (ldiff list (last list n)) ; Almost

There's at least one case where that's not true:

(let ((list '(a b c . d)))
  (values (butlast list 0) (ldiff list (last list 0))))
→ (A B C . D)
  (A B C)
byte
Function

Returns an object of implementation-dependent nature.

byte-position
Function
byte-size
Function
caaaar
Accessor

If I ever needed to do this, and I don't see why I would,
I'd write out (car (car (car (car cons)))) that one time.

caaadr
Accessor

Not useful.

caaar
Accessor
caadar
Accessor
caaddr
Accessor
caadr
Accessor
caar
Accessor
cadaar
Accessor
cadadr
Accessor
cadar
Accessor
caddar
Accessor
cadddr
Accessor

I prefer fourth.

caddr
Accessor

I prefer third.

cadr
Accessor

I prefer second.

call-arguments-limit
Constant variable
call-method
Local macro
call-next-method
Local function
car
Accessor

Normally accesses the car slot of a cons, but (car nil) → nil.

In contexts where the car of a cons to access is semantically the first element of a list, using first might indicate intent better.

case
Macro

One of my nominations for "most glaring X3J13 concession": Besides t, case also accepts otherwise to designate the "otherwise" clause. (Does anyone use the otherwise notation??)

catch
Special operator

block is generally preferable to catch because it's easier to reason about.

This doesn't really have anything to do with exception handling.

catch differs from block in that catch tags have dynamic scope while block names have lexical scope.

It is customary for symbols to be used as tags, but any object is permitted. However, numbers should not be used because the comparison is done using eq.

ccase
Macro
cdaaar
Accessor
cdaadr
Accessor
cdaar
Accessor
cdadar
Accessor
cdaddr
Accessor
cdadr
Accessor
cdar
Accessor
cddaar
Accessor
cddadr
Accessor
cddar
Accessor
cdddar
Accessor
cddddr
Accessor
(cddddr list) == (nthcdr 4 list)
cdddr
Accessor
(cdddr list) == (nthcdr 3 list)
cddr
Accessor

This is the most useful of the operators in the "CXR" family besides car and cdr. Its primary utility is helping to traverse plists, most commonly with loop or do. It would be less useful if more direct support for iteration over plists was added...

Personally I don't use operators in the "CXR" family besides car, cdr and cddr. You might also prefer the arguably more "modern" alternatives I like to use.

I guess the multiple "CXR" variations must have been a more important convenience shortcut notation when list processing had a much bigger role in Lisp...

cdr
Accessor

Normally accesses the "cdr" slot of a cons, but (cdr nil) → nil.

In contexts where the "cdr" of a cons to access is semantically the rest of a list, using rest might indicate intent better.

ceiling
Function
cell-error
Condition type
cell-error-name
Function
cerror
Function
change-class
Generic function
char
Accessor
(char string index) == (aref (the string string) index)
char-code
Function

Many assume at least ASCII but the standard offers no such guarantee.

char-code-limit
Constant variable
char-downcase
Function
char-equal
Function
char-greaterp
Function
char-int
Function

If character has no implementation-defined attributes, the results of char-int and char-code are the same.

char-lessp
Function
char-name
Function
char-not-equal
Function
char-not-greaterp
Function
char-not-lessp
Function
char-upcase
Function
char/=
Function
char<
Function
char<=
Function
char=
Function
(char= c1 c2) == (= (char-int c1) (char-int c2))
char>
Function
char>=
Function
character
Function
(character object) == (coerce object 'character)
System class
Glossary entry
characterp
Function
(characterp object) == (typep object 'character)
check-type
Macro

[the optional third argument] string is allowed because some applications of check-type may require a more specific description of what is wanted than can be generated automatically from typespec.

(check-type alist list "an alist")
cis
Function
class
System class
class-name
Generic function

The name of an anonymous class is nil.

The MOP extends this to return any kind of object, not necessarily a symbol.

class-of
Function
clear-input
Function
clear-output
Function
close
Function
clrhash
Function
code-char
Function

Might return nil.

coerce
Function
compilation-speed
Optimize quality
compile
Function

One of the great distinguishing features of Common Lisp is that the compiler is available at runtime!

compile-file
Function
compile-file-pathname
Function
compiled-function
Type
compiled-function-p
Function
(compiled-function-p object) == (typep object 'compiled-function)
compiler-macro
Documentation type
compiler-macro-function
Accessor
complement
Function
complex
Function
System class
Glossary entry
complexp
Function
compute-applicable-methods
Generic function

Here's a simplistic function that attempts to determine if a certain generic-function is capable of accepting some specific arguments, with many caveats (TODO: explain the assumptions and caveats):

(defun supports-operation-p (generic-function &rest args)
  (member nil (compute-applicable-methods generic-function args)
          :key #'method-qualifiers))
compute-restarts
Function
concatenate
Function

All of the sequences are copied from; the result does not share any structure with any of the sequences. Therefore, if only one sequence is provided and it is of type result-type, concatenate is required to copy sequence rather than simply returning it.

concatenated-stream
System class
concatenated-stream-streams
Function
cond
Macro
condition
Condition type
conjugate
Function
cons
Function
System class
Glossary entry
consp
Function
(consp object) == (not (atom object))
constantly
Function
constantp
Function
continue
Function
Restart
control-error
Condition type
copy-alist
Function
copy-list
Function

Differs from copy-seq with a list argument only in that it correctly handles dotted lists.

The consequences are undefined if list is a circular list.

copy-pprint-dispatch
Function
copy-readtable
Function
copy-seq
Function

From a functional standpoint,

(copy-seq x) == (subseq x 0)

However, the programmer intent is typically very different in these two cases.

copy-structure
Function
copy-symbol
Function
copy-tree
Function
cos
Function
cosh
Function
count
Function
count-if
Function
count-if-not
Function

The standard says it's deprecated but the community decided otherwise.

ctypecase
Macro
debug
Optimize quality
decf
Macro (decf place) is basically equivalent to (setf place (1- place)) except without multiple evaluation of the place.
declaim
Macro
declaration
Declaration
declare
Symbol
decode-float
Function
decode-universal-time
Function
defclass
Macro

I like to prefix all private class slots with "%" to be more explicit and avoid accidental "leaking":

(defclass foo ()
  (%function))

In the above example, using a slot name of "function" would likely have used the symbol from the Common Lisp package. Subsequently, users of the package might come under the false impression that the slot is part of the public interface.

It's common practice to prefix "internal" symbols with "%". It's always possible to access any symbol from a package with the "package::symbol" notation but referring to %-prefixed symbols in this way is solely the (ir)responsibility of the user.

Here's how to avoid "leaking" a writer while still retaining the convenience of having an accessor for the implementor:

(defclass foo ()
  ((%bar :reader foo-bar :accessor %foo-bar)))

Each of the :initarg, :reader, :writer and :accessor slot options can be specified multiple times for a single class slot. The "sum" of the options will take effect.

Newbies are often tempted to wrap defclass with a macro that removes the explicitness, automatically generating :initarg and :accessor options from a slot's name, for instance. This is misguided. defclass' explicitness is in fact a very great feature, though this may not be immediately apparent if one goes by more "traditional" approaches to OO. Using the far superior OO approaches which Common Lisp enables (like generic-functions protocols) makes it easier to appreciate how the various slot options are more independent than they may first appear.

defconstant
Macro

User constants should always use the +naming-convention+ for constants (starting and ending the symbol's name with "+") even though none of the standard constants do so.

defgeneric
Macro

Redefining a DEFGENERIC with removed :method options will automatically remove the corresponding methods, which is quite convenient.

defgeneric expands to a call to ensure-generic-function.

define-compiler-macro
Macro

Compiler macros really help obeying the mantra of "never use a macro if a function will do".

define-condition
Macro
define-method-combination
Macro

My nomination for most complex (though justified) syntax in Common Lisp. It's truly breathtaking!

define-modify-macro
Macro
define-setf-expander
Macro

This is the most general and powerful way to make new kinds of setfable places, but also the most complex.

In simple cases, defining a setf-function or using the simple form of defsetf often suffices.

It's also possible to make local setf functions with flet or labels.
Just use (setf name) as function name.

If even that is not powerful enough for you, you might like setf-expanderlet.

define-symbol-macro
Macro
defmacro
Macro

DSL tip: Don't build thick macro layers. Instead, start by building a solid foundation of functions and objects, then add a thin layer of syntactic sugar with macros at the end. Your system will be much more flexible and well-considered this way.

It's almost never a good idea to generate user-visible symbols as part of macroexpansions (like defstruct does). Make the user pass a symbol explicitly instead. (TODO: explain why doing the former leads to problems and doing the latter averts them and is much cleaner.)

Correct handling of all declarations in macros usually doesn't happen by accident. You'll often have to parse them and carefully put the right declarations in the right places in the expansion. This is an often overlooked macro quality issue.

I dislike macros that expand to calls to themselves, as interactive macroexpansion might not reveal all the work of the macro at once. The user might then feel compelled to manually expand the result recursively, which can be a pretty annoying thing to do.

Macro design: Full code walking implies full macroexpansion of all macros, which almost guarantees an ugly, unreadable macroexpand result. In addition, full code walking is a conceptually and implementationally complex approach fraught with perils.

I like to design the semantics of my macros which would otherwise require full code walking such that simply including calls to flet, macrolet and symbol-macrolet in the expansion suffices.

defmethod
Macro

lisptip: "Referring to method parameters" (explicit VS implicit specializer)

defpackage
Macro
defparameter
Macro
defsetf
Macro
defstruct
Macro

I'd recommend always using defclass instead, unless you absolutely, provably need the better performance of structures. In a good Common Lisp implementation, normal classes are probably much more performant than you'd think given their quite dynamic nature.

There's no portable way to directly instantiate a DEFSTRUCT structure using a (:constructor nil) option (unless a non-nil :constructor option is also specified), but doing it can still be useful to declare "abstract structures" that another DEFSTRUCT can then "inherit" from with the :include option.

deftype
Macro
defun
Macro

Note that the first argument is a "function name", which includes not only symbols but also lists of the form (setf name), used to define setf functions.

If you need to actually use (and not just refer to) the function you're defining at compile-time (including at macroexpansion-time) in the same file, you'll need to wrap your defun with eval-when.

defvar
Macro
delete
Function

You can think of this as "nremove".

delete-duplicates
Function

The elements of sequence are compared pairwise, and if any two match, then the one occurring earlier in sequence is discarded, unless from-end is true, in which case the one later in sequence is discarded.

delete-file
Function
delete-if
Function
delete-if-not
Function

The standard says it's deprecated but the community decided otherwise.

delete-package
Function
denominator
Function
deposit-field
Function
describe
Function
describe-object
Generic function

lisptip: "Describing objects"

describe-object is called by describe; it must not be called by the user.

destructuring-bind
Macro
digit-char
Function
digit-char-p
Function
directory
Function
directory-namestring
Function
disassemble
Function
division-by-zero
Condition type
do
Macro
do*
Macro
do-all-symbols
Macro
do-external-symbols
Macro
do-symbols
Macro
documentation
Generic function
dolist
Macro
dotimes
Macro
double-float
Type
double-float-epsilon
Constant variable
double-float-negative-epsilon
Constant variable
dpb
Function
dribble
Function
dynamic-extent
Declaration
ecase
Macro
echo-stream
System class
echo-stream-input-stream
Function
echo-stream-output-stream
Function
ed
Function
eighth
Accessor
(eighth list) == (nth 7 list)
elt
Accessor

Like all sequence functions, honors a vector's fill pointer, if any.

aref may be used to access vector elements that are beyond the vector's fill pointer.

encode-universal-time
Function
end-of-file
Condition type
endp
Function
enough-namestring
Function
ensure-directories-exist
Function
ensure-generic-function
Function
eq
Function

eq basically compares two memory addresses. This makes for very efficient comparisons.

It also means it can't reliably compare numbers and characters. Never use eq to compare values that might involve numbers or characters. Use eql in that case.

Most Common Lisp operators use eql rather than eq to compare objects, or else they default to eql and only use eq if specifically requested to do so. However, the following operators are defined to use eq rather than eql in a way that cannot be overridden by the code which employs them:

catch, get, get-properties, getf, remf, remprop, throw.

eql
Function

eql is a simple extension to eq that guarantees a meaningful result when comparing numbers and characters.

Comparing numbers and characters with eq would ignore the fact that two semantically equivalent number or character values might live at different addresses.

For instance, (eq (1+ most-positive-fixnum) (1+ most-positive-fixnum)) might very well return nil. This would be the case if two separate bignum values were allocated. eql or = in this case would reliably return T.

Various other Common Lisp implementation choices might also make eq comparisons of numbers and characters unreliable, such as optimizations that put "unboxed" values of numbers in registers or on the stack. These might of course vary in effects depending on the specific context of each invocation of eq.

Bottom line, never use eq to compare values that might involve numbers or characters.

If an implementation supports positive and negative zeros as distinct values, then (eql 0.0 -0.0) returns false. Otherwise, when the syntax -0.0 is read it is interpreted as the value 0.0, and so (eql 0.0 -0.0) returns true.

Normally (eql 1.0s0 1.0d0) is false, under the assumption that 1.0s0 and 1.0d0 are of distinct data types. However, implementations that do not provide four distinct floating-point formats are permitted to ``collapse'' the four formats into some smaller number of them; in such an implementation (eql 1.0s0 1.0d0) might be true.

eql may not be true of two floats even when they represent the same value. = is used to compare mathematical values.

Combining type specifier
Parameter specializer

In a (eql object) specializer, object is evaluated. Thus, to check if the corresponding argument to the method is the symbol my-little-symbol, use (eql 'my-little-symbol).

equal
Function

Object equality is not a concept for which there is a uniquely determined correct algorithm. The appropriateness of an equality predicate can be judged only in the context of the needs of some particular program. Although these functions take any type of argument and their names sound very generic, equal and equalp are not appropriate for every application.

I highly recommend Kent Pitman's classic "The Best of Intentions: EQUAL rights - and Wrongs - in Lisp" article regarding such matter.

equalp
Function
error
Condition type
Function
Glossary entry
etypecase
Macro
eval
Function

In at least 99% of cases where one might think of using this, there's a better way.

One mistake many newbies make is using eval at macroexpansion time. That's almost certainly a mistake. The primary job of a macro is returning an expansion. It's the expansion that will do the actual work at runtime, including any side-effects.

Macros should almost never produce side-effects as part of the macroexpansion process, especially as one macro call might be expanded multiple times for various reasons.

See eval-when.

eval-when
Special operator

In many cases, when "compile-time side-effects" are desired in a macro, what one should actually do is something like this:

(defmacro define-foo (name ...)
  `(progn
     (eval-when (:compile-toplevel :load-toplevel :execute)
       ;; "Register" metadata about the definition.
       (setf (gethash ',name *foos*) ...))
     ;; rest of the expansion
     ...))

In more than 99% of cases where eval-when is needed, one needs to specify all situations:

(eval-when (:compile-toplevel :load-toplevel :execute)
                        ...)

Think that's too long? You might like enhanced-eval-when, which lets you do:

(eval-when t
  (defun my-function ...))

eval-when without all situations specified is not particularly useful (outside of a few expert cases) and notoriously difficult to reason about.

evenp
Function

Should signal an error of type type-error if integer is not an integer.

(evenp 1/2) → error
(evenp integer)
==
(if (integerp integer)
    (zerop (mod integer 2))
    (error ...))
every
Function
exp
Function
export
Function
expt
Function
extended-char
Type
fboundp
Function

This tests the function namespace, which includes not only functions but also macros and special operators.

(fboundp 'defun) → t
(fboundp 'unwind-protect) → t

As for boundp, this examines only the global environment. Lexical bindings are ignored.

Accepts a "function name": A symbol or a list (setf symbol).

Defining a setf expander F does not cause the setf function (setf F) to become defined.

fceiling
Function
fdefinition
Accessor

Accepts a "function name": A symbol or a list (setf symbol).

The value returned by fdefinition when fboundp returns true but the function-name denotes a macro or special form is not well-defined, but fdefinition does not signal an error.

Again, this has nothing to do with lexical bindings.

ffloor
Function
fifth
Accessor
(fifth list) == (nth 4 list)
file-author
Function
file-error
Condition type
file-error-pathname
Function
file-length
Function

Returns nil if the length cannot be determined.

For a binary file, the length is measured in units of the element type of the stream.

There doesn't seem to be any specification of how the length of character file stream is determined so I guess it's implicitly implementation-dependent.

file-namestring
Function
file-position
Function

lisptip: "A little bit of file-position" (about :start and :end)

This is a bit of a peculiar "2-in-1" function.

One might wonder why it hasn't just been made an accessor. I guess it's because the writer needs to return success-p, which it couldn't (comfortably) do if it were an accessor since these by convention always return the new value(s) that was (were) written.

Probably a bit of an archaic note but I found it somewhat interesting:

Implementations that have character files represented as a sequence of records of bounded size might choose to encode the file position as, for example, <<record-number>>*<<max-record-size>>+<<character-within-record>>. This is a valid encoding because it increases monotonically as each character is read or written, though not necessarily by 1 at each step. An integer might then be considered ``inappropriate'' as position-spec to file-position if, when decoded into record number and character number, it turned out that the supplied record was too short for the specified character number.

file-stream
System class
file-string-length
Function

This has nothing to do with determining the length of a file. See file-length.

The returned value corresponds to the current state of stream at the time of the call and might not be the same if it is called again when the state of the stream has changed.

file-write-date
Function

Might return nil if the date can't be determined.

fill
Function
(fill sequence item)
== (nsubstitute-if item (constantly t) sequence)
fill-pointer
Accessor

There is no operator that will remove a vector's fill pointer.

find
Function
find-all-symbols
Function
find-class
Accessor
find-if
Function
find-if-not
Function

The standard says it's deprecated but the community decided otherwise.

find-method
Generic function
find-package
Function
find-restart
Function
find-symbol
Function
finish-output
Function

Synchronous. The operation will have completed by the time the function returns.

See also: force-output. (asynchronous)

first
Accessor
fixnum
Type

This is specified to be a type, not a class, so you can't portably dispatch on it.

flet
Special operator

The following is suboptimal because even though foo won't be used in body, it's still in scope there, arguably increasing cognitive load (especially if body is complex):

(flet ((foo (arg) ...))
  (let ((a (foo x))
        (b (foo y)))
    body))

One might prefer to reduce the scope of the local function to the minimum possible instead, like this:

(multiple-value-bind (a b)
    (flet ((foo (arg) ...))
      (values (foo x) (foo y)))
  body)

It's possible to make local setf functions.
Just use (setf name) as function name.

If even that is not powerful enough for you, you might like setf-expanderlet.

float
Function

If [the optional second argument] prototype is not supplied, then if the number is already a float, it is returned; otherwise, a float is returned that is mathematically equal to number but is a single float.

System class
Glossary entry
float-digits
Function
float-precision
Function
float-radix
Function
float-sign
Function
floating-point-inexact
Condition type
floating-point-invalid-operation
Condition type
floating-point-overflow
Condition type
floating-point-underflow
Condition type
floatp
Function
(floatp object) == (typep object 'float)
floor
Function
fmakunbound
Function
force-output
Function

Asynchronous. The operation may or may not have completed by the time the function returns.

See also: finish-output. (synchronous)

format
Function

lisptip: "Dynamic format control" (about "V")

lisptip: "Pluralization" (about "~P")

(format nil "~S" object) == (prin1-to-string object)
(format stream "~A" object) == (princ object stream)
Format directive Function To string
~W write write-to-string
~S prin1 prin1-to-string
~A princ princ-to-string
~% terpri
~& fresh-line
formatter
Macro
fourth
Accessor
fresh-line
Function
fround
Function
ftruncate
Function
ftype
Declaration
funcall
Function

Yes, this is just a function!

funcall is really just a thin wrapper over apply that allows for more convenient function calling notation and easier optimization:

(funcall function arg1 arg2 arg3)
==
(apply function (list arg1 arg2 arg3))

Ignoring optimizations, funcall could simply be defined as:

(defun funcall (function &rest args)
  (apply function args))
function
Special operator
Documentation type
System class
Glossary entry
function-keywords
Generic function

Probably most useful in define-method-combination.

Note that the standard only specifies this to work on standard methods and not, for instance, "normal" functions.

In a sense, this might be better named "method-keywords", though an implementation could also define a method specialized on "normal" functions.

function-lambda-expression
Function

A common question is: "How to get the code from a function?"
This function does that... maybe!

The primary value, lambda-expression, is function's defining lambda expression, or nil if the information is not available. [...] Any implementation may legitimately return nil as the lambda-expression of any function.

Life is hard!

A common workaround is to make a wrapper macro around defun that saves the body of the function being defined somewhere.

functionp
Function
(functionp object) == (typep object 'function)
gcd
Function
generic-function
System class
gensym
Function

The result of (gensym "VAR") might print with escapes, depending on (readtable-case *readtable*). (gensym (string '#:var)) averts this.

Here's a simple function that returns a new "gensym series generator":

(defun gensyms (&optional default-base)
  (let ((counter 0))
    (lambda (&optional (base (or default-base (error "No base"))))
      (gensym (format nil "~A~D-" base (incf counter))))))
gentemp
Function

Use gensym instead.

get
Accessor

Usage of symbol property lists is generally frowned upon nowadays.

get-decoded-time
Function
(get-decoded-time) == (decode-universal-time (get-universal-time))
get-dispatch-macro-character
Function
get-internal-real-time
Function
get-internal-run-time
Function
get-macro-character
Function
get-output-stream-string
Function

lisptip: "string output streams" (about autoflush and reuse)

get-properties
Function

One of those relatively obscure functions that may deserve a bit more recognition...

Erik Naggum found a nice use for it. While searching for a use for nreconc, no less!

getf is a simpler version that searches for only one property and returns only its value (or a supplied default, if not found).

get-setf-expansion
Function
get-universal-time
Function

lisptip: "The Common Lisp and Unix epochs" (about get-unix-time)

getf
Accessor

There is no way (using getf) to distinguish an absent property from one whose value is default; but see get-properties.

(getf plist indicator default)
==
(let ((wrapped-indicator (list indicator)))
  (declare (dynamic-extent wrapped-indicator))
  (multiple-value-bind (indicator value tail)
      (get-properties plist wrapped-indicator)
    (declare (ignore indicator))
    (if tail value default)))
gethash
Accessor

Note the optional argument default and second return value present-p.

The secondary value, present-p, can be used to distinguish the absence of an entry from the presence of an entry that has a value of default.

To remove an entry from the hash-table, use remhash.

To efficiently remove all entries from the hash-table, use clrhash.

There are three standard operators for iterating over all entries of a hash-table:

maphash
(maphash (lambda (key value)
           ...)
         hash-table)
with-hash-table-iterator
(with-hash-table-iterator (entry hash-table)
  (loop (multiple-value-bind (more key value) (entry)
          (unless more
            (return))
          ...)))
loop

TODO. Le sigh.

go
Special operator
graphic-char-p
Function
handler-bind
Macro

By the time a handler-bind handler is executed, the dynamic context has not yet been unwound.

(block nil
  (let ((*dynamic-context* 'outer))
    (declare (special *dynamic-context*))
    (handler-bind ((simple-condition
                    (lambda (condition)
                      (declare (ignore condition))
                      (return *dynamic-context*))))
      (let ((*dynamic-context* 'inner))
        (declare (special *dynamic-context*))
        (signal "Test.")))))

Compare to handler-case.

handler-case
Macro

By the time a handler-case clause is executed, the dynamic context has already been unwound.

(block nil
  (let ((*dynamic-context* 'outer))
    (declare (special *dynamic-context*))
    (handler-case (let ((*dynamic-context* 'inner))
                    (declare (special *dynamic-context*))
                    (signal "Test."))
      (simple-condition ()
        (return *dynamic-context*)))))

Compare to handler-bind.

It took me an embarrassing amount of time to realize this is loosely modeled on typecase.

hash-table
System class
hash-table-count
Function
hash-table-p
Function
(hash-table-p object) == (typep object 'hash-table)
hash-table-rehash-size
Function
hash-table-rehash-threshold
Function
hash-table-size
Function

Returns some implementation-dependent size which has to do with the internal size of the hash-table. This value is greater or equal to the actual number of items in hash-table.

You might be looking for hash-table-count.

hash-table-test
Function
host-namestring
Function
identity
Function
if
Special operator
ignorable
Declaration
ignore
Declaration
ignore-errors
Macro
imagpart
Function
import
Function
in-package
Macro
incf
Macro
initialize-instance
Generic function

Immediately forwards to shared-initialize.

Here's a way to canonicalize ("transform") an initarg very "early" in the object instance initialization process. The canonicalization will affect all initialize-instance :before, :after and primary methods (thus including slots initialized by an ":initarg" option.)

(defmethod initialize-instance :around
    ((object my-class)
     &rest initargs &key key &allow-other-keys)
  (apply #'call-next-method object :key (canonicalize key)
         initargs))
inline
Declaration
input-stream-p
Function

Interestingly enough, this is not a thin wrapper around a (non-existent) standard input-stream type. (There might or might not be one internally.)

inspect
Function
integer
System class
integer-decode-float
Function
integer-length
Function
integerp
Function
(integerp object) == (typep object 'integer)
interactive-stream-p
Function
intern
Function
internal-time-units-per-second
Constant variable
intersection
Function
invalid-method-error
Function
invoke-debugger
Function
invoke-restart
Function

Restart functions call invoke-restart, not vice versa. That is, invoke-restart provides primitive functionality, and restart functions are non-essential ``syntactic sugar.''

invoke-restart-interactively
Function
isqrt
Function
keyword
Type

This is specified to be a type, not a class, so you can't portably dispatch on it.

keywordp
Function
(keywordp object) == (typep object 'keyword)
labels
Special operator

All local functions declared within the labels invocation are in scope of eachother and themselves, thus permitting mutual recursion and self-recursion.

lambda
Macro

Thanks to this convenience macro, you never need to write #'(lambda ...), (lambda ...) suffices!

Note however that there are contexts where (lambda ...) works but #'(lambda ...) doesn't. Specifically, where an unevaluated lambda expression is expected. Of course, it's a bit of a moot point if you always use the shorter form anyway, which I recommend...

Compilation to trees of closures is my favorite Common Lisp technique! It allows easy impl of DSLs with the expressiveness of a high-level language AND the performance of a low-level language.

Symbol
The lambda form
((lambda lambda-list . body) . arguments)
is semantically equivalent to the function form
(funcall #'(lambda lambda-list . body) . arguments)

(Of course the "#'" can be omitted, again.)

lambda-list-keywords
Constant variable
lambda-parameters-limit
Constant variable
last
Function

last returns the last n conses (not the last n elements) of list).

To get the last element, just do (first (last list)).

If n is zero, the atom that terminates list is returned.

(last '(a b) 0) → NIL
(last '(a b . c) 0) → C
(defun proper-list-p (object)
  (and (listp object) (null (last object 0))))
lcm
Function
ldb
Accessor

Historically, the name ``ldb'' comes from a DEC PDP-10 assembly language instruction meaning ``load byte.''

ldb-test
Function
ldiff
Function
least-negative-double-float
Constant variable
least-negative-long-float
Constant variable
least-negative-normalized-double-float
Constant variable
least-negative-normalized-long-float
Constant variable
least-negative-normalized-short-float
Constant variable
least-negative-normalized-single-float
Constant variable
least-negative-short-float
Constant variable
least-negative-single-float
Constant variable
least-positive-double-float
Constant variable
least-positive-long-float
Constant variable
least-positive-normalized-double-float
Constant variable
least-positive-normalized-long-float
Constant variable
least-positive-normalized-short-float
Constant variable
least-positive-normalized-single-float
Constant variable
least-positive-short-float
Constant variable
least-positive-single-float
Constant variable
length
Function
let
Special operator
let*
Special operator
lisp-implementation-type
Function
lisp-implementation-version
Function
list
Function

(list 'a 'b 'c) is not the same as '(a b c), at all.

The former creates a fresh list at every invocation. It's safe (for the "owner") to destructively modify this list.

The latter might always return the same (shared) list at every invocation. Attempting to destructively modify this list has undefined consequences.

System class
Glossary entry
list*
Function

Constructs an improper (dotted) list unless the last argument is a proper (nil-terminated) list.

For many use-cases, can be thought of as a variant of cons that allows to prepend any number of list elements (instead of just one) to a list.

This is particularly useful to add elements to or override elements from a plist:

(let ((plist '(:old c :overridden d)))
  (destructuring-bind (&rest new-plist &key old new overridden)
      (list* :new 'a :overridden 'b plist)
    (values new-plist old new overridden)))
→
(:NEW A :OVERRIDDEN B :OLD C :OVERRIDDEN D)
C
A
B
list-all-packages
Function
list-length
Function

This is not a faster variant of length for lists.

In fact, it's a probably-slower variant that can reliably detect circular lists and return nil in that case.

listen
Function
listp
Function

If object is a cons, listp does not check whether object is a proper list; it returns true for any kind of list.

To check if something is a proper list, see last.

(listp object) == (typep object 'list)
== (typep object '(or cons null))
load
Function
load-logical-pathname-translations
Function
load-time-value
Special operator

Can be used instead of read-time evaluation ("#.") in some cases.

Sometimes useful to precompute and cache a value early.

locally
Special operator
log
Function

log may return a complex when given a real negative number.

The result of (log 8 2) may be either 3 or 3.0, depending on the implementation. An implementation can use floating-point calculations even if an exact integer result is possible.

logand
Function
logandc1
Function
logandc2
Function
logbitp
Function
(logbitp k n) == (ldb-test (byte 1 k) n)
logcount
Function

Known as "popcount" in some other languages.

logeqv
Function
logical-pathname
Function
System class
logical-pathname-translations
Accessor
logior
Function
lognand
Function
lognor
Function
lognot
Function
logorc1
Function
logorc2
Function
logtest
Function
(logtest x y) == (not (zerop (logand x y)))
logxor
Function
long-float
Type
long-float-epsilon
Constant variable
long-float-negative-epsilon
Constant variable
long-site-name
Function
loop
Macro

TODO: Say something constructive.

loop-finish
Local macro
lower-case-p
Function
machine-instance
Function
machine-type
Function
machine-version
Function
macro-function
Accessor
macroexpand
Function
macroexpand-1
Function
macrolet
Special operator

Interactive macroexpansion of calls to macrolet-defined macros is not commonly supported, so it's sometimes more pragmatic to use defmacro.

[...] the consequences are undefined if the local macro definitions reference any local variable or function bindings that are visible in that lexical environment.

You might like macro-level.

make-array
Function

It's possible to make a zero-dimensional array. Such an array is not a sequence (like multi-dimensional arrays) and has one single element, for the same reason that (apply #'* '()) → 1.

(let ((box (make-array '() :initial-element 'e)))
  (values (aref box) (array-total-size box)))
→ E, 1.
#5(1 2 3) → #(1 2 3 3 3)
(array-dimensions #2a((a1 a2) (b1 b2) (c1 c2))) → (3 2)
make-broadcast-stream
Function

lisptip: "Discarding output" (how to "redirect to /dev/null")

make-concatenated-stream
Function

lisptip: "A concatenated stream trick" (preventing closing of a stream)

make-condition
Function
make-dispatch-macro-character
Function
make-echo-stream
Function
make-hash-table
Function
make-instance
Generic function
make-instances-obsolete
Generic function

Each affected instance may be updated only the next time one of its slots is accessed or otherwise queried.

make-list
Function
make-load-form
Generic function
make-load-form-saving-slots
Function
make-method
Local macro
make-package
Function
make-pathname
Function
make-random-state
Function
make-sequence
Function
make-string
Function
make-string-input-stream
Function
make-string-output-stream
Function
make-symbol
Function
make-synonym-stream
Function
make-two-way-stream
Function
makunbound
Function
map
Function
map-into
Function
mapc
Function
mapcan
Function
mapcar
Function
mapcon
Function
maphash
Function
mapl
Function
maplist
Function
mask-field
Accessor
max
Function
member
Function

member returns a tail of the list. How to get the "head"?

(let ((list '(a b 7 c)))
  (ldiff list (member-if #'numberp list)))
→ (A B)
Combining type specifier
member-if
Function
member-if-not
Function

The standard says it's deprecated but the community decided otherwise.

merge
Function
merge-pathnames
Function
method
System class
method-combination
System class
Documentation type
method-combination-error
Function
method-qualifiers
Generic function
min
Function
minusp
Function
mismatch
Function
mod
Function
Abbreviating type specifier
most-negative-double-float
Constant variable
most-negative-fixnum
Constant variable
most-negative-long-float
Constant variable
most-negative-short-float
Constant variable
most-negative-single-float
Constant variable
most-positive-double-float
Constant variable
most-positive-fixnum
Constant variable
most-positive-long-float
Constant variable
most-positive-short-float
Constant variable
most-positive-single-float
Constant variable
muffle-warning
Function
Restart
multiple-value-bind
Macro
(multiple-value-bind (a b c) (foo)
  ...)
==
(multiple-value-call (lambda (&optional a b c &rest rest)
                       (declare (ignore rest))
                       ...)
  (foo))

I used to write this:

(let ((a (if c x y))
      (b (if c foo bar)))
  ...)

Now I prefer this instead:

(multiple-value-bind (a b)
    (if c
        (values x foo)
        (values y bar))
  ...)

This is highly likely to be efficient and has so many advantages! (TODO: refactor the following into a list) We don't duplicate the condition, which is easier to write and to read, especially as the condition gets more complex. In fact, if it gets complex enough or involves side-effects we might otherwise extract it into another binding, which we'll need to name (also with the cognitive overhead associated with knowing that the binding is still in scope for the body but won't be used there):

(let* ((blah (my so very complex condition))
       (a (if blah x y))
       (b (if blah foo bar)))
  ...)

Here's a similar version, but you shouldn't use it because it might just allocate some conses and do some type checks at runtime:

(destructuring-bind (a b)
    (if c
        (list x foo)
        (list y bar))
  ...)

Here's a trick that saves some indentation:

(multiple-value-bind (a1 a2 b c1 c2 c3)
    (multiple-value-call #'values
      (values 1 2)
      3
      (values 4 5 6))
  ...)

Compared to this:

(multiple-value-bind (a1 a2) (values 1 2)
  (let ((b 3))
    (multiple-value-bind (c1 c2 c3) (values 4 5 6)
      ...)))
multiple-value-call
Special operator

multiple-value-call helped me understand continuation-passing-style: returning values is equivalent to calling a continuation with those values.

It also showed me how function arguments and return values are such close duals of each other. Future languages, please take return values more seriously!

(lambda (required &optional (optional nil optional-supplied-p))
  (if optional-supplied-p
      (foo required optional)
      (foo required)))
==>
(lambda (required &optional (optional nil optional-supplied-p))
  (multiple-value-call #'foo
    required
    (if optional-supplied-p
        optional
        (values))))
multiple-value-list
Macro

(multiple-value-list form) == (multiple-value-call #'list form)

(apply #'foo bar (multiple-value-list (baz))) is ugly and inefficient, as it conses up a throwaway list of the return values of (baz). (multiple-value-call #'foo bar (baz)) is more likely to be efficient and arguably represents intent better.

multiple-value-prog1
Special operator
multiple-value-setq
Macro

lisptip: "(setf values)"

multiple-values-limit
Constant variable
name-char
Function
namestring
Function
nbutlast
Function
nconc
Function

My nomination for "most little-used feature in Common Lisp": ",." is to ",@" as nconc is to append. It makes sense that it's so little used because it's pretty hard to reason about (at least to me) and the potential efficiency gains are probably not worth the trouble in most cases.

next-method-p
Local function
nil
Constant variable
Type

The type nil contains no objects and so is also called the empty type. The type nil is a subtype of every type. No object is of type nil.

The type containing the object nil is the type null, not the type nil.

Glossary entry
nintersection
Function
ninth
Function
no-applicable-method
Generic function
no-next-method
Generic function
not
Function
Combining type specifier
notany
Function
notevery
Function
notinline
Declaration
nreconc
Function
nreverse
Function
nset-difference
Function
nset-exclusive-or
Function
nstring-capitalize
Function
nstring-downcase
Function
nstring-upcase
Function
nsublis
Function

Because the side-effecting variants (e.g., nsublis) potentially change the path that is being traversed, their effects in the presence of shared or circular structure structure may vary in surprising ways when compared to their non-side-effecting alternatives. [...]

nsubst
Function
nsubst-if
Function
nsubst-if-not
Function

The standard says it's deprecated but the community decided otherwise.

nsubstitute
Function
nsubstitute-if
Function
nsubstitute-if-not
Function

The standard says it's deprecated but the community decided otherwise.

nth
Accessor
(nth n list) == (car (nthcdr n list))
nth-value
Macro
nthcdr
Function
null
Function

null is intended to be used to test for the empty list whereas not is intended to be used to invert a boolean (or generalized boolean). Operationally, null and not compute the same result; which to use is a matter of style.

(null object) == (typep object 'null) == (eq object '())
System class
Glossary entry
number
System class
numberp
Function
(numberp object) == (typep object 'number)
numerator
Function