All standard symbols
This table is unmaintained and awaiting scavenging.
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.
I don't think this table justifies its existence in its current form, and updating it to a worthwhile form would take so much effort that it's not worth the opportunity cost. I might revisit this one day (and refactor it into something that's not a table) if my infrastructure allows for an effective and meaningful scavenging operation.
Sorry, the table is not mobile-optimized.
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):
This is safe because 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):
|
⚓ | &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 |
lisptip: "Binding keyword arguments" lisptip: "Duplicated keyword arguments" 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 Use &rest to capture a list of all keyword arguments in the order they appear in the call. |
⚓ | &optional |
Lambda list keyword | |
⚓ | &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 apply is very related. |
⚓ | &whole |
Lambda list keyword |
The captured macro call form includes the macro operator itself, not just the (unevaluated) arguments. |
⚓ | * |
Function | |
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 | |
⚓ | *compile-file-truename* |
Variable | |
⚓ | *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 | |
⚓ | *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 |
lisptip: "Printing package-qualified symbols" |
⚓ | *print-array* |
Variable | |
⚓ | *print-base* |
Variable | |
⚓ | *print-case* |
Variable | |
⚓ | *print-circle* |
Variable | |
⚓ | *print-escape* |
Variable |
lisptip: "Printing package-qualified symbols" |
⚓ | *print-gensym* |
Variable | |
⚓ | *print-length* |
Variable | |
⚓ | *print-level* |
Variable | |
⚓ | *print-lines* |
Variable | |
⚓ | *print-miser-width* |
Variable | |
⚓ | *print-pprint-dispatch* |
Variable | |
⚓ | *print-pretty* |
Variable |
lisptip: "Slow pretty-printing" |
⚓ | *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 | |
Variable |
lisptip: "Evaluating the last expression" ("#.+") |
Method combination type | |
⚓ | ++ |
Variable | |
⚓ | +++ |
Variable | |
⚓ | - |
Function | |
Variable | |
⚓ | / |
Function |
Many programming languages support two kinds of division operations, both of which are imprecise: Integer divisionIn 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.
Common Lisp supports this type of division. Simply pass floating-point numbers to /:
(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:
|
Variable | |
⚓ | // |
Variable | |
⚓ | /// |
Variable | |
⚓ | /= |
Function | |
⚓ | 1+ |
Function | |
⚓ | 1- |
Function | |
⚓ | < |
Function | |
⚓ | <= |
Function | |
⚓ | = |
Function | |
⚓ | > |
Function | |
⚓ | >= |
Function | |
⚓ | abort |
Function | |
Restart | |
⚓ | abs |
Function | |
⚓ | acons |
Function | |
⚓ | acos |
Function | |
⚓ | acosh |
Function | |
⚓ | add-method |
Generic function |
The usual way of adding a method to a generic-function is with defmethod. |
⚓ | adjoin |
Function | |
⚓ | 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 | |
⚓ | and |
Macro |
lisptip: ""How do I apply AND?"" |
Combining type specifier | |
Method combination type | |
⚓ | append |
Function |
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 |
⚓ | apply |
Function |
Yes, this is just a function! 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 |
Little-known array functions: array-total-size, array-rank, array-dimension, row-major-aref, array-row-major-index, array-in-bounds-p. |
⚓ | array-dimension |
Function | |
⚓ | array-dimension-limit |
Constant variable | |
⚓ | array-dimensions |
Function | |
⚓ | array-displacement |
Function |
lisptip: "Un-displacing an array" |
⚓ | array-element-type |
Function | |
⚓ | array-has-fill-pointer-p |
Function | |
⚓ | array-in-bounds-p |
Function | |
⚓ | array-rank |
Function | |
⚓ | array-rank-limit |
Constant variable | |
⚓ | array-row-major-index |
Function | |
⚓ | array-total-size |
Function |
See also: row-major-aref |
⚓ | array-total-size-limit |
Constant variable | |
⚓ | arrayp |
Function | |
⚓ | ash |
Function |
Newbies sometimes have difficulty locating this function. |
⚓ | asin |
Function | |
⚓ | asinh |
Function | |
⚓ | assert |
Macro | |
⚓ | assoc |
Function | |
⚓ | assoc-if |
Function | |
⚓ | assoc-if-not |
Function | |
⚓ | atan |
Function | |
⚓ | atanh |
Function | |
⚓ | atom |
Function |
Everything that is not a cons is an atom, including nil. 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 | |
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 | |
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-xor |
Function | |
⚓ | block |
Special operator |
Informally, this is the static, lexical counterpart of catch. |
⚓ | 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 | |
⚓ | both-case-p |
Function | |
⚓ | boundp |
Function | |
⚓ | break |
Function | |
⚓ | broadcast-stream |
System class | |
⚓ | broadcast-stream-streams |
Function | |
⚓ | built-in-class |
System class | |
⚓ | butlast |
Function | |
⚓ | byte |
Function |
Returns an object of implementation-dependent nature. |
⚓ | byte-position |
Function | |
⚓ | byte-size |
Function | |
⚓ | caaaar |
Accessor | |
⚓ | caaadr |
Accessor | |
⚓ | caaar |
Accessor | |
⚓ | caadar |
Accessor | |
⚓ | caaddr |
Accessor | |
⚓ | caadr |
Accessor | |
⚓ | caar |
Accessor | |
⚓ | cadaar |
Accessor | |
⚓ | cadadr |
Accessor | |
⚓ | cadar |
Accessor | |
⚓ | caddar |
Accessor | |
⚓ | cadddr |
Accessor | |
⚓ | caddr |
Accessor | |
⚓ | cadr |
Accessor | |
⚓ | 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 |
⚓ | case |
Macro | |
⚓ | catch |
Special operator |
This doesn't really have anything to do with exception handling. |
⚓ | 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 | |
⚓ | cdddr |
Accessor | |
⚓ | 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 |
⚓ | ceiling |
Function | |
⚓ | cell-error |
Condition type | |
⚓ | cell-error-name |
Function | |
⚓ | cerror |
Function | |
⚓ | change-class |
Generic function | |
⚓ | char |
Accessor | |
⚓ | 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 | |
⚓ | 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> |
Function | |
⚓ | char>= |
Function | |
⚓ | character |
Function | |
System class | |
Glossary entry | |
⚓ | characterp |
Function | |
⚓ | check-type |
Macro | |
⚓ | cis |
Function | |
⚓ | class |
System class | |
⚓ | class-name |
Generic function |
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 | |
⚓ | 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):
|
⚓ | compute-restarts |
Function | |
⚓ | concatenate |
Function | |
⚓ | concatenated-stream |
System class | |
⚓ | concatenated-stream-streams |
Function | |
⚓ | cond |
Macro | |
⚓ | condition |
Condition type | |
⚓ | conjugate |
Function | |
⚓ | cons |
Function | |
System class | |
Glossary entry | |
⚓ | consp |
Function | |
⚓ | 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. |
⚓ | copy-pprint-dispatch |
Function | |
⚓ | copy-readtable |
Function | |
⚓ | copy-seq |
Function | |
⚓ | copy-structure |
Function | |
⚓ | copy-symbol |
Function | |
⚓ | copy-tree |
Function | |
⚓ | cos |
Function | |
⚓ | cosh |
Function | |
⚓ | count |
Function | |
⚓ | count-if |
Function | |
⚓ | count-if-not |
Function | |
⚓ | ctypecase |
Macro | |
⚓ | debug |
Optimize quality | |
⚓ | decf |
Macro | |
⚓ | declaim |
Macro | |
⚓ | declaration |
Declaration | |
⚓ | declare |
Symbol | |
⚓ | decode-float |
Function | |
⚓ | decode-universal-time |
Function | |
⚓ | defclass |
Macro |
lisptip: ":initform and :default-initargs" Each of the |
⚓ | 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 |
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. 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 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 I like to design the semantics of my macros which would otherwise require full code walking such that simply including calls to |
⚓ | defmethod |
Macro |
lisptip: "Referring to method parameters" (explicit VS implicit specializer) |
⚓ | defpackage |
Macro |
lisptip: "Multiple export clauses in defpackage" lisptip: "The four causes of symbol conflicts" |
⚓ | defparameter |
Macro | |
⚓ | defsetf |
Macro | |
⚓ | defstruct |
Macro |
There's no portable way to directly instantiate a DEFSTRUCT structure using a |
⚓ | deftype |
Macro |
lisptip: "The optional arguments of deftype" |
⚓ | defun |
Macro |
Note that the first argument is a "function name", which includes not only symbols but also lists of the form 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 | |
⚓ | delete-file |
Function | |
⚓ | delete-if |
Function | |
⚓ | delete-if-not |
Function | |
⚓ | delete-package |
Function | |
⚓ | denominator |
Function | |
⚓ | deposit-field |
Function | |
⚓ | describe |
Function | |
⚓ | describe-object |
Generic function |
lisptip: "Describing objects" |
⚓ | destructuring-bind |
Macro | |
⚓ | digit-char |
Function | |
⚓ | digit-char-p |
Function |
lisptip: "Converting characters to integers" |
⚓ | 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 | |
⚓ | elt |
Accessor |
Like all sequence functions, honors a vector's fill pointer, if any. |
⚓ | encode-universal-time |
Function | |
⚓ | end-of-file |
Condition type | |
⚓ | endp |
Function | |
⚓ | enough-namestring |
Function | |
⚓ | ensure-directories-exist |
Function | |
⚓ | ensure-generic-function |
Function | |
⚓ | eq |
Function | |
⚓ | 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, 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. |
Combining type specifier | |
Parameter specializer |
In a |
⚓ | equal |
Function |
I highly recommend Kent Pitman's classic "The Best of Intentions: EQUAL rights - and Wrongs - in Lisp" article regarding such matter. |
⚓ | equalp |
Function |
lisptip: "The usefullness of EQUALP" |
⚓ | 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:
In more than 99% of cases where eval-when is needed, one needs to specify all situations:
Think that's too long? You might like enhanced-eval-when, which lets you do:
eval-when without all situations specified is not particularly useful (outside of a few expert cases) and notoriously difficult to reason about. |
⚓ | evenp |
Function | |
⚓ | 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.
As for boundp, this examines only the global environment. Lexical bindings are ignored. |
⚓ | fceiling |
Function | |
⚓ | fdefinition |
Accessor |
Again, this has nothing to do with lexical bindings. |
⚓ | ffloor |
Function | |
⚓ | fifth |
Accessor | |
⚓ | file-author |
Function | |
⚓ | file-error |
Condition type | |
⚓ | file-error-pathname |
Function | |
⚓ | file-length |
Function |
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 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. |
⚓ | file-stream |
System class | |
⚓ | file-string-length |
Function |
This has nothing to do with determining the length of a file. See file-length. |
⚓ | file-write-date |
Function |
Might return nil if the date can't be determined. |
⚓ | fill |
Function | |
⚓ | fill-pointer |
Accessor | |
⚓ | find |
Function | |
⚓ | find-all-symbols |
Function | |
⚓ | find-class |
Accessor | |
⚓ | find-if |
Function | |
⚓ | find-if-not |
Function | |
⚓ | find-method |
Generic function | |
⚓ | find-package |
Function | |
⚓ | find-restart |
Function | |
⚓ | find-symbol |
Function | |
⚓ | finish-output |
Function |
lisptip: "Forcing buffered output" 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 |
It's possible to make local setf functions. If even that is not powerful enough for you, you might like setf-expanderlet. |
⚓ | float |
Function | |
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 | |
⚓ | floor |
Function | |
⚓ | fmakunbound |
Function | |
⚓ | force-output |
Function |
lisptip: "Forcing buffered output" 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") lisptip: "Multi-line format control strings" lisptip: "Formatting integers in different radixes" |
⚓ | 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:
Ignoring optimizations, funcall could simply be defined as:
|
⚓ | 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 | |
⚓ | functionp |
Function | |
⚓ | gcd |
Function | |
⚓ | generic-function |
System class | |
⚓ | gensym |
Function |
Here's a simple function that returns a new "gensym series generator":
|
⚓ | gentemp |
Function | |
⚓ | get |
Accessor | |
⚓ | get-decoded-time |
Function | |
⚓ | 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 |
⚓ | getf |
Accessor | |
⚓ | gethash |
Accessor |
Note the optional argument default and second return value present-p. 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
with-hash-table-iterator
loopTODO. 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.
Compare to handler-case. |
⚓ | handler-case |
Macro |
By the time a handler-case clause is executed, the dynamic context has already been unwound.
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-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
|
⚓ | 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 | |
⚓ | 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 | |
⚓ | 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 | |
⚓ | 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 |
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 | |
⚓ | lambda-list-keywords |
Constant variable | |
⚓ | lambda-parameters-limit |
Constant variable | |
⚓ | last |
Function | |
⚓ | lcm |
Function | |
⚓ | ldb |
Accessor | |
⚓ | 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:
|
⚓ | 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 | |
⚓ | 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 | |
⚓ | logand |
Function | |
⚓ | logandc1 |
Function | |
⚓ | logandc2 |
Function | |
⚓ | logbitp |
Function | |
⚓ | 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 | |
⚓ | 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 You might like macro-level. |
⚓ | make-array |
Function |
lisptip: "Working on multidimensional arrays" 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
|
⚓ | 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 |
lisptip: "Initialize a vector with map-into" |
⚓ | 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"?
|
Combining type specifier | |
⚓ | member-if |
Function | |
⚓ | member-if-not |
Function | |
⚓ | merge |
Function |
lisptip: "Adding an item to a sorted list" |
⚓ | 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 |
I used to write this:
Now I prefer this instead:
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):
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:
Here's a trick that saves some indentation:
Compared to this:
You might like enhanced-multiple-value-bind. |
⚓ | 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! |
⚓ | multiple-value-list |
Macro |
|
⚓ | 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 | |
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 | |
⚓ | nsubst |
Function | |
⚓ | nsubst-if |
Function | |
⚓ | nsubst-if-not |
Function | |
⚓ | nsubstitute |
Function | |
⚓ | nsubstitute-if |
Function | |
⚓ | nsubstitute-if-not |
Function | |
⚓ | nth |
Accessor | |
⚓ | nth-value |
Macro | |
⚓ | nthcdr |
Function | |
⚓ | null |
Function | |
System class | |
Glossary entry | |
⚓ | number |
System class | |
⚓ | numberp |
Function | |
⚓ | numerator |
Function | |
⚓ | nunion |
Function | |
⚓ | oddp |
Function | |
⚓ | open |
Function |
lisptip: "Touching a file" Use with-open-file unless you need the file to remain open for further processing. |
⚓ | open-stream-p |
Function | |
⚓ | optimize |
Declaration | |
⚓ | or |
Macro | |
Combining type specifier | |
⚓ | otherwise |
Symbol | |
⚓ | output-stream-p |
Function | |
⚓ | package |
System class | |
⚓ | package-error |
Condition type | |
⚓ | package-error-package |
Function | |
⚓ | package-name |
Function | |
⚓ | package-nicknames |
Function | |
⚓ | package-shadowing-symbols |
Function | |
⚓ | package-use-list |
Function | |
⚓ | package-used-by-list |
Function | |
⚓ | packagep |
Function | |
⚓ | pairlis |
Function | |
⚓ | parse-error |
Condition type | |
⚓ | parse-integer |
Function |
lisptip: ":start and :end with parse-integer" |
⚓ | parse-namestring |
Function |
Given a stream associated with a file, returns the file's pathname. |
⚓ | pathname |
Function | |
System class | |
Glossary entry | |
⚓ | pathname-device |
Function | |
⚓ | pathname-directory |
Function | |
⚓ | pathname-host |
Function | |
⚓ | pathname-match-p |
Function | |
⚓ | pathname-name |
Function | |
⚓ | pathname-type |
Function | |
⚓ | pathname-version |
Function | |
⚓ | pathnamep |
Function | |
⚓ | peek-char |
Function |
To check if the next character in a stream is immediately available, use read-char-no-hang. |
⚓ | phase |
Function | |
⚓ | pi |
Constant variable | |
⚓ | plusp |
Function | |
⚓ | pop |
Macro | |
⚓ | position |
Function | |
⚓ | position-if |
Function | |
⚓ | position-if-not |
Function | |
⚓ | pprint |
Function | |
⚓ | pprint-dispatch |
Function | |
⚓ | pprint-exit-if-list-exhausted |
Local macro | |
⚓ | pprint-fill |
Function | |
⚓ | pprint-indent |
Function | |
⚓ | pprint-linear |
Function | |
⚓ | pprint-logical-block |
Macro | |
⚓ | pprint-newline |
Function | |
⚓ | pprint-pop |
Local macro | |
⚓ | pprint-tab |
Function | |
⚓ | pprint-tabular |
Function | |
⚓ | prin1 |
Function | |
⚓ | prin1-to-string |
Function | |
⚓ | princ |
Function | |
⚓ | princ-to-string |
Function | |
⚓ | |
Function | |
⚓ | print-not-readable |
Condition type | |
⚓ | print-not-readable-object |
Function | |
⚓ | print-object |
Generic function | |
⚓ | print-unreadable-object |
Macro |
The cornerstone of most simple user print-object methods! You'll almost always want to supply This is specified as always returning nil, not the object. That's a very curious choice, since print-unreadable-object is typically used as the core of print-object methods, which are specified as returning the object that has been printed. But don't worry, users are not supposed to call print-object anyway, and given that the universe hasn't collapsed yet, I can only assume that all implementations have learned not to rely on the value returned by print-object long ago. There's probably not much point to auditing all your code to make sure print-object methods correctly return the object that was printed. |
⚓ | probe-file |
Function | |
⚓ | proclaim |
Function | |
⚓ | prog |
Macro | |
⚓ | prog* |
Macro | |
⚓ | prog1 |
Macro | |
⚓ | prog2 |
Macro | |
⚓ | progn |
Special operator | |
⚓ | program-error |
Condition type | |
⚓ | progv |
Special operator | |
⚓ | provide |
Function | |
⚓ | psetf |
Macro | |
⚓ | psetq |
Macro | |
⚓ | push |
Macro |
A few people sometimes complain about the argument order, but it's pretty intuitive if one considers that |
⚓ | pushnew |
Macro | |
⚓ | quote |
Special operator | |
⚓ | random |
Function | |
⚓ | random-state |
System class | |
⚓ | random-state-p |
Function | |
⚓ | rassoc |
Function | |
⚓ | rassoc-if |
Function | |
⚓ | rassoc-if-not |
Function | |
⚓ | ratio |
System class | |
⚓ | rational |
Function | |
System class | |
Glossary entry | |
⚓ | rationalize |
Function | |
⚓ | rationalp |
Function | |
⚓ | read |
Function | |
⚓ | read-byte |
Function | |
⚓ | read-char |
Function | |
⚓ | read-char-no-hang |
Function | |
⚓ | read-delimited-list |
Function | |
⚓ | read-from-string |
Function | |
⚓ | read-line |
Function | |
⚓ | read-preserving-whitespace |
Function | |
⚓ | read-sequence |
Function | |
⚓ | reader-error |
Condition type | |
⚓ | readtable |
System class | |
⚓ | readtable-case |
Accessor | |
⚓ | readtablep |
Function | |
⚓ | real |
System class | |
⚓ | realp |
Function | |
⚓ | realpart |
Function | |
⚓ | reduce |
Function | |
⚓ | reinitialize-instance |
Generic function | |
⚓ | rem |
Function | |
⚓ | remf |
Macro | |
⚓ | remhash |
Function | |
⚓ | remove |
Function | |
⚓ | remove-duplicates |
Function | |
⚓ | remove-if |
Function | |
⚓ | remove-if-not |
Function | |
⚓ | remove-method |
Generic function | |
⚓ | remprop |
Function | |
⚓ | rename-file |
Function | |
⚓ | rename-package |
Function | |
⚓ | replace |
Function | |
⚓ | require |
Function |
In some implementations you can still use this to invoke implementation-dependent code loading mechanisms. |
⚓ | rest |
Accessor | |
⚓ | restart |
System class | |
⚓ | restart-bind |
Macro | |
⚓ | restart-case |
Macro | |
⚓ | restart-name |
Function | |
⚓ | return |
Macro | |
⚓ | return-from |
Special operator | |
⚓ | revappend |
Function | |
⚓ | reverse |
Function | |
⚓ | room |
Function | |
⚓ | rotatef |
Macro |
lisptip: "Swapping places" |
⚓ | round |
Function | |
⚓ | row-major-aref |
Accessor |
lisptip: "Working on multidimensional arrays" See also: array-total-size. |
⚓ | rplaca |
Function | |
⚓ | rplacd |
Function | |
⚓ | safety |
Optimize quality | |
⚓ | satisfies |
Predicating type specifier | |
⚓ | sbit |
Accessor | |
⚓ | scale-float |
Function | |
⚓ | schar |
Accessor | |
⚓ | search |
Function | |
⚓ | second |
Accessor | |
⚓ | sequence |
System class | |
⚓ | serious-condition |
Condition type | |
⚓ | set |
Function | |
⚓ | set-difference |
Function | |
⚓ | set-dispatch-macro-character |
Function | |
⚓ | set-exclusive-or |
Function | |
⚓ | set-macro-character |
Function | |
⚓ | set-pprint-dispatch |
Function | |
⚓ | set-syntax-from-char |
Function | |
⚓ | setf |
Macro |
The key to understanding setfable places lies in the definitions of
|
Documentation type | |
⚓ | setq |
Special operator | |
⚓ | seventh |
Accessor | |
⚓ | shadow |
Function | |
⚓ | shadowing-import |
Function | |
⚓ | shared-initialize |
Generic function | |
⚓ | shiftf |
Macro | |
⚓ | short-float |
Type | |
⚓ | short-float-epsilon |
Constant variable | |
⚓ | short-float-negative-epsilon |
Constant variable | |
⚓ | short-site-name |
Function | |
⚓ | signal |
Function | |
⚓ | signed-byte |
Type | |
⚓ | signum |
Function | |
⚓ | simple-array |
Type | |
⚓ | simple-base-string |
Type | |
⚓ | simple-bit-vector |
Type | |
⚓ | simple-bit-vector-p |
Function | |
⚓ | simple-condition |
Condition type | |
⚓ | simple-condition-format-arguments |
Function | |
⚓ | simple-condition-format-control |
Function | |
⚓ | simple-error |
Condition type | |
⚓ | simple-string |
Type | |
⚓ | simple-string-p |
Function | |
⚓ | simple-type-error |
Condition type | |
⚓ | simple-vector |
Type | |
⚓ | simple-vector-p |
Function | |
⚓ | simple-warning |
Condition type | |
⚓ | sin |
Function | |
⚓ | single-float |
Type | |
⚓ | single-float-epsilon |
Constant variable | |
⚓ | single-float-negative-epsilon |
Constant variable | |
⚓ | sinh |
Function | |
⚓ | sixth |
Accessor | |
⚓ | sleep |
Function | |
⚓ | slot-boundp |
Function | |
⚓ | slot-exists-p |
Function | |
⚓ | slot-makunbound |
Function | |
⚓ | slot-missing |
Generic function | |
⚓ | slot-unbound |
Generic function |
lisptip: "Lazy slots" ( |
⚓ | slot-value |
Function | |
⚓ | software-type |
Function | |
⚓ | software-version |
Function | |
⚓ | some |
Function | |
⚓ | sort |
Function |
Continually confused about |
⚓ | space |
Declaration | |
⚓ | special |
Declaration | |
⚓ | special-operator-p |
Function | |
⚓ | speed |
Declaration | |
⚓ | sqrt |
Function | |
⚓ | stable-sort |
Function | |
⚓ | standard |
Method combination type | |
⚓ | standard-char |
Type | |
⚓ | standard-char-p |
Function | |
⚓ | standard-class |
System class | |
⚓ | standard-generic-function |
System class | |
⚓ | standard-method |
System class | |
⚓ | standard-object |
Class | |
⚓ | step |
Macro | |
⚓ | storage-condition |
Condition type | |
⚓ | store-value |
Function | |
Restart | |
⚓ | stream |
System class | |
⚓ | stream-element-type |
Function | |
⚓ | stream-error |
Condition type | |
⚓ | stream-error-stream |
Function | |
⚓ | stream-external-format |
Function | |
⚓ | streamp |
Function | |
⚓ | string |
Function |
lisptip: "String functions" (sequence functions also work on strings) |
System class | |
Glossary entry | |
⚓ | string-capitalize |
Function | |
⚓ | string-downcase |
Function | |
⚓ | string-equal |
Function | |
⚓ | string-greaterp |
Function | |
⚓ | string-left-trim |
Function | |
⚓ | string-lessp |
Function | |
⚓ | string-not-equal |
Function | |
⚓ | string-not-greaterp |
Function | |
⚓ | string-not-lessp |
Function | |
⚓ | string-right-trim |
Function | |
⚓ | string-stream |
System class | |
⚓ | string-trim |
Function | |
⚓ | string-upcase |
Function | |
⚓ | string/= |
Function |
Most string comparison operators return a mismatch-index, not just a generalized boolean! |
⚓ | string< |
Function | |
⚓ | string<= |
Function | |
⚓ | string= |
Function | |
⚓ | string> |
Function | |
⚓ | string>= |
Function | |
⚓ | stringp |
Function | |
⚓ | structure |
Documentation type | |
⚓ | structure-class |
System class | |
⚓ | structure-object |
Class | |
⚓ | style-warning |
Condition type | |
⚓ | sublis |
Function | |
⚓ | subseq |
Accessor | |
⚓ | subsetp |
Function | |
⚓ | subst |
Function | |
⚓ | subst-if |
Function |
lisptip: "The tree-walkers of CL" |
⚓ | subst-if-not |
Function | |
⚓ | substitute |
Function | |
⚓ | substitute-if |
Function | |
⚓ | substitute-if-not |
Function | |
⚓ | subtypep |
Function |
Interesting return values! Two booleans meaning "Yes, definitely", "Definitely not" or "I'm not sure exactly, let's assume not." |
⚓ | svref |
Accessor | |
⚓ | sxhash |
Function | |
⚓ | symbol |
System class | |
⚓ | symbol-function |
Accessor | |
⚓ | symbol-macrolet |
Special operator | |
⚓ | symbol-name |
Function | |
⚓ | symbol-package |
Function | |
⚓ | symbol-plist |
Accessor | |
⚓ | symbol-value |
Accessor | |
⚓ | symbolp |
Function | |
⚓ | synonym-stream |
System class | |
⚓ | synonym-stream-symbol |
Function | |
⚓ | t |
Constant variable |
Note that predicate functions generally return a generalized-boolean, not necessarily a boolean. |
Documentation type | |
System class | |
Glossary entry | |
⚓ | tagbody |
Special operator | |
⚓ | tailp |
Function | |
⚓ | tan |
Function | |
⚓ | tanh |
Function | |
⚓ | tenth |
Accessor | |
⚓ | terpri |
Function |
That's all it does! It doesn't flush the output or anything. |
⚓ | the |
Special operator | |
⚓ | third |
Accessor | |
⚓ | throw |
Special operator |
This doesn't really have anything to do with exception handling. |
⚓ | time |
Macro | |
⚓ | trace |
Macro |
Especially useful in functional code, such as code that builds up a data structure (for example a tree) recursively. |
⚓ | translate-logical-pathname |
Function | |
⚓ | translate-pathname |
Function | |
⚓ | tree-equal |
Function |
lisptip: "The tree-walkers of CL" |
⚓ | truename |
Function | |
⚓ | truncate |
Function | |
⚓ | two-way-stream |
System class |
All two-way streams are bidirectional, but the two terms are not equivalent. |
⚓ | two-way-stream-input-stream |
Function | |
⚓ | two-way-stream-output-stream |
Function | |
⚓ | type |
Declaration |
Exclusive bounds for compound type specifiers: |
Documentation type | |
Glossary entry | |
⚓ | type-error |
Condition type | |
⚓ | type-error-datum |
Function | |
⚓ | type-error-expected-type |
Function | |
⚓ | type-of |
Function |
This can return somewhat surprising, implementation-dependent results. For instance, on SBCL:
class-of is more likely to be useful:
|
⚓ | typecase |
Macro | |
⚓ | typep |
Function | |
⚓ | unbound-slot |
Condition type | |
⚓ | unbound-slot-instance |
Function | |
⚓ | unbound-variable |
Condition type | |
⚓ | undefined-function |
Condition type | |
⚓ | unexport |
Function | |
⚓ | unintern |
Function | |
⚓ | union |
Function | |
⚓ | unless |
Macro | |
⚓ | unread-char |
Function | |
⚓ | unsigned-byte |
Type | |
⚓ | untrace |
Function | |
⚓ | unuse-package |
Function | |
⚓ | unwind-protect |
Special operator | |
⚓ | update-instance-for-different-class |
Generic function | |
⚓ | update-instance-for-redefined-class |
Generic function | |
⚓ | upgraded-array-element-type |
Function | |
⚓ | upgraded-complex-part-type |
Function | |
⚓ | upper-case-p |
Function | |
⚓ | use-package |
Function | |
⚓ | use-value |
Function | |
Restart | |
⚓ | user-homedir-pathname |
Function | |
⚓ | values |
Accessor |
Some people may not realize how frigging efficient multiple-value returns/binding really is. This might explain in part why it's underused. I sometimes find fruitful to indicate a function's return values similarly to its arguments:
Here's a dead-simple (and simplistic?) accumulator pattern:
(TODO: An example use would be nice.) |
Specializing type specifier | |
⚓ | values-list |
Function | |
⚓ | variable |
Documentation type | |
⚓ | vector |
Function | |
System class | |
Glossary entry | |
⚓ | vector-pop |
Function | |
⚓ | vector-push |
Function | |
⚓ | vector-push-extend |
Function | |
⚓ | vectorp |
Function | |
⚓ | warn |
Function | |
⚓ | warning |
Condition type | |
⚓ | when |
Macro | |
⚓ | wild-pathname-p |
Function | |
⚓ | with-accessors |
Macro | |
⚓ | with-compilation-unit |
Macro | |
⚓ | with-condition-restarts |
Macro | |
⚓ | with-hash-table-iterator |
Macro | |
⚓ | with-input-from-string |
Macro |
My nomination for "most obscure Common Lisp feature hidden in plain sight": with-input-from-string's index argument. Somewhat complicated semantics. |
⚓ | with-open-file |
Macro | |
⚓ | with-open-stream |
Macro | |
⚓ | with-output-to-string |
Macro | |
⚓ | with-package-iterator |
Macro | |
⚓ | with-simple-restart |
Macro |
lisptip: "Controlling loop flow with simple restarts" lisptip: "Trying again with with-simple-restart" |
⚓ | with-slots |
Macro | |
⚓ | with-standard-io-syntax |
Macro | |
⚓ | write |
Function |
Don't forget the handy printer variable keyword arguments:
|
⚓ | write-byte |
Function | |
⚓ | write-char |
Function | |
⚓ | write-line |
Function | |
⚓ | write-sequence |
Function | |
⚓ | write-string |
Function | |
⚓ | write-to-string |
Function | |
⚓ | y-or-n-p |
Function | |
⚓ | yes-or-no-p |
Function | |
⚓ | zerop |
Function |
Other lisptips:
lisptip: "Slime Tips (link)"
lisptip: "Stylish Common Lisp"
lisptip: "PAIP lessons"
lisptip: "Comparing many objects"
lisptip: "Fine-grained control flow"
lisptip: "Multiple value division"
lisptip: "Division shortcuts"
lisptip: "Graham Crackers"
lisptip: "Putting the R in REPL"
lisptip: "A brief history of Lisp"
lisptip: "Semicolon style"
lisptip: "How do I convert an integer to a list of bits?"
lisptip: "Literal syntax for integers"