There are 234 utilities.
 octet v1.0

A type representing an octet: 8 bits. If a positive integer
n
is specified, then(octet n)
represents8n
bits. This can often be used for optimization in Common Lisp. Provides
octet
 positivep v1.0

Check if
n
is positive. Provides
positivep
 negativep v1.0

Check if
n
is negative. Provides
negativep
 nonnegativep v1.0

Check if
n
is nonnegative. Provides
nonnegativep
 nonpositivep v1.0

Check if
n
is nonpositive. Provides
nonpositivep
 nonzerop v1.0

Check if
n
is nonzero. Provides
nonzerop
 digitcount v2.0

Compute the number of digits in the nonnegative integer
n
in basebase
. By default, the base is 10. Provides
digitcount
 rangeproduct v1.0

Compute
lower * (lower+1) * ... * (upper1) * upper
. Provides
rangeproduct
 factorial v1.0

Compute the factorial of
n
, wheren! = 1 * 2 * ... * n
. Provides
factorial
 Requires
 rangeproduct
 binomialcoefficient v1.0

Binomial coefficient of
n
andk
. Provides
binomialcoefficient
 Requires
 factorial, rangeproduct
 mulf v1.0

A modifying version of multiplication, similar to
incf
. Provides
mulf
 divf v1.0

A modifying version of division, similar to
decf
. Provides
divf
 half v1.0

Compute half of
x
. Provides
half
 double v1.0

Compute double
x
. Provides
double
 square v1.0

Compute the square of
x
. Provides
square
 cube v1.0

Compute the cube of
x
. Provides
cube
 digits v1.0

Return a list of the digits of the nonnegative integer
n
in basebase
. By default, decimal digits are returned.The order of the digits is such that the
k
th element of the list refers to the coefficient ofbase^k
. In other words, given the resulting list(c0 c1 c2 ... ck)
the following identity holds:
n = c0 + c1*base + c2*base^2 + ... + ck*base^k.
 Provides
digits
 nthdigit v1.0

Get the
n
th digit in a rational numbernumber
in basebase
. Ifn
is positive, it refers to digits to the left of the decimal point, and if negative, to the right. The digits of a negative number match that of its positive counterpart. Provides
nthdigit
 bitvectorinteger v1.0

Convert a bit vector
bv
to a positive integer. The bits of the integer are ordered from most significant to least significant, unlessleastsignificantfirst
is true. Provides
bitvectorinteger
 integerbitvector v1.0

Convert a positive integer
n
to a bit vector. The least significant bits will be first ifleastsignificantfirst
is true. Provides
integerbitvector
 primesbelow v1.0

Return a sorted list of all primes below an integer
n
.Examples:
(primesbelow 13) => (2 3 5 7 11) (primesbelow 1) => NIL
 Provides
primesbelow
 sec v1.0

Compute the secant of a number
z
. Provides
sec
 csc v1.0

Compute the cosecant of a number
z
. Provides
csc
 cot v1.0

Compute the cotangent of a number
z
. Provides
cot
 asec v1.0

Compute the arcsecant of a number
z
. Provides
asec
 acsc v1.0

Compute the arccosecant of a number
z
. Provides
acsc
 acot v1.0

Compute the arccotangent of a number
z
. Provides
acot
 sortcopy v1.0

Copying versions of
cl:sort
andcl:stablesort
. Provides
sortcopy
,stablesortcopy
 take v1.0

Take the first
n
elements fromsequence
. Provides
take
 drop v1.0

Drop the first
n
elements fromsequence
. Provides
drop
 subdivide v1.0

Split
sequence
into subsequences of sizechunksize
. Provides
subdivide
 ngrams v1.0

Find all
n
grams of the sequencesequence
. Provides
ngrams
 Requires
 take
 partitionif v1.0

Partition sequences based off of a predicate.
 Provides
partitionif
,partitionifnot
 equivalenceclasses v1.0

Partition the sequence
seq
into a list of equivalence classes defined by the equivalence relationequiv
. Provides
equivalenceclasses
 doseq v1.0

Iterate across the sequence
seq
, binding the variablevar
to each element of the sequence and executingbody
. Return the valuereturn
from the iteration form. Provides
doseq
 range v1.0

Return the list of numbers
n
such thatstart <= n < end
andn = start + k*step
for suitable integersk
. If a functionkey
is provided, then apply it to each number. Provides
range
 replicate v1.0

Make a list of
n
copies ofx
. Provides
replicate
 slice v1.0

Compute the slice of a list
list
at indexesindexes
. Provides
slice
 transpose v1.0

Analog to matrix transpose for a list of lists given by
lists
. Provides
transpose
 zip v1.0

Take a tuple of lists and turn them into a list of tuples. Equivalent to
unzip
. Provides
zip
 Requires
 transpose
 unzip v1.0

Take a list of tuples and return a tuple of lists. Equivalent to
zip
. Provides
unzip
 Requires
 transpose
 longzip v1.0

zip
using the longest, rather than shortest list, filling withfill
. Provides
longzip
 Requires
 zip
 enumerate v1.0

Equivalent to
(zip (iota (length list)) list)
. Provides
enumerate
 flattenonce v1.0

Flatten
list
once. Provides
flattenonce
 flattentaggedonce v1.0

Flatten once a list
x
with a tagtag
. Provides
flattentaggedonce
 flatten v1.0

Flatten (and append) all lists
xs
completely. Provides
flatten
 ncycle v1.0

Mutate
list
into a circlular list. Provides
ncycle
 cycle v1.0

Make
list
into a circular list. Provides
cycle
 Requires
 ncycle
 nest v1.0

Compute a
count
compositions offunction
oninitialvalue
. Provides
nest
 nestlist v1.0

Compute a list of
count
compositions offunction
oninitialvalue
. Provides
nestlist
 safenth v1.0

Find the
n
th element oflist
. Ifn
is out of bounds, returnifoutofbounds
(nil
by default). Provides
safenth
 mapply v1.0

Apply
f
to each list of arguments contained withinlist
and collect the results. Provides
mapply
 cartesianproduct v1.0

Compute the cartesian product of
l1
andl2
as if they were sets. Optionally, map the functionf
across the product. Provides
cartesianproduct
 end v1.0

Return the last element of
list
and whether or not it was empty. Provides
end
 tabulate v1.0

Return a list evaluations of
f
over the integers[0,n)
. Mimics the SML function of the same name. Provides
tabulate
 Requires
 range
 collectreduce v1.0

Collects intermediate reduction results of applying
f
tolist
. More or less equivalent to(loop :for i :in list :collect (reduce f i))
. Provides
collectreduce
 weave v1.0

Return a list whose elements alternate between each of the lists
lists
. Weaving stops when any of the lists has been exhausted. Provides
weave
 interleave v1.0

Return a list whose elements alternate between each of the lists
lists
. When a list has been exhausted, interleaving continues with whatever other nonempty lists. Provides
interleave
 riffle v1.0

Insert the item
obj
in between each element oflist
. Provides
riffle
 extend v1.0

Adjoin
x
to the end ofxs
. Provides
extend
 listtovector v1.0

Convert
list
into a vector. Provides
listtovector
 sequencetolist v1.0

Convert the sequence
seq
into a list. Provides
sequencetolist
 explode v1.0

The classic
explode
function. Take a string and return a list of its characters. Provides
explode
 Requires
 sequencetolist
 implode v1.0

The classic
implode
function. Take a list of characters and return the corresponding string. Provides
implode
 Requires
 listtovector
 inits v1.0

Generate a list of initial sublists of the list
list
. The nameinits
comes from the Haskell function of the same name.Example:
> (inits '(a b c d)) (NIL (A) (A B) (A B C) (A B C D))
 Provides
inits
 tails v1.0

Generate a list of tails of the list
list
. The nametails
comes from the Haskell function of the same name.Example
> (tails '(a b c d)) ((A B C D) (B C D) (C D) (D) NIL)
 Provides
tails
 stringappend v1.0

Append strings or a sequence of strings together.
 Provides
stringappend
,stringappend*
 separatedstringappend v1.0

Append strings or a sequence of strings, separated by a separator.
 Provides
separatedstringappend
,separatedstringappend*
 stringappendspace v1.0

Concatenate
strings
separated by a single space. Provides
stringappendspace
 Requires
 separatedstringappend
 fix v1.0

Apply the fixedpoint combinator, also known as the Ycombinator, to the function
F : (A > B) > A > B
. Provides
fix
 flip v1.0

Return a function whose argument order of a binary function
f
is reversed. Provides
flip
 applyable v1.0

Given a function
fun
, return a variadic function which results infun
being called on the passed argument list. (Note:fun
will not be applied to the passed argument list.)The resulting function is able to be applied to lists as a result (hence "appliable").
 Provides
applyable
 applying v1.0

Given a function
fun
, return a unary function whose result is applyingfun
to the single argument. Provides
applying
 composeapply v1.0

Create a variadic function whose result is applying the function
fun
to results obtained by applying each offuns
to the argument list.Example:
` (defvar averagevalues (composeapply '/ '+ (applyable 'length))) (defvar averagelist (composeapply '/ (applying '+) 'length))
(funcall averagevalues 1 2 3) => 2 (funcall averagelist '(1 2 3) => 2 ```
 Provides
composeapply
 rerankarray v1.0

Reshape
array
to have dimensions specified bydimensions
, possibly with a different rank than the original. The dimensions ofarray
and the givendimensions
must have the same total number of elements. Provides
rerankarray
 vectorrange v1.0

Compute the equivalent of
(coerce (range a b :step step) 'vector)
. Provides
vectorrange
 vectorslice v1.0

Compute the slice of a vector
v
at indexesindexes
. Provides
vectorslice
 vectorassociativereduce v1.0

Reduce
vector
withassociativefunction
, using a divideandconquer method. Provides
vectorassociativereduce
 arraycontents v1.0

Extract the contents of the array
array
, returning a value that would be suitable to pass to the:initialcontents
keyword argument ofmakearray
. Provides
arraycontents
 executiontime v1.0

Return the number of milliseconds it takes to execute
body
. Also returns the result as the second value. Provides
executiontime
 maptree v1.0

Map
function
to each of the leave oftree
. Provides
maptree
 treememberp v1.0

Returns
t
ifitem
is intree
,nil
otherwise. Provides
treememberp
 treecollect v1.0

Returns a list of every node in the
tree
that satisfies thepredicate
. If there are any improper lists in the tree, thepredicate
is also applied to their dotted elements. Provides
treecollect
 samename v1.0

Do symbols
a
andb
have the same name? Provides
samename
 ensurekeyword v1.0

Ensure that a keyword is returned for the string designator
x
. Provides
ensurekeyword
 mkstr v1.0

Receives any number of objects (string, symbol, keyword, char, number), extracts all printed representations, and concatenates them all into one string.
Extracted from On Lisp, chapter 4.
 Provides
mkstr
 symb v1.0

Receives any number of objects, concatenates all into one string with
#'mkstr
and converts them to symbol.Extracted from On Lisp, chapter 4.
See also:
symbolicate
 Provides
symb
 Requires
 mkstr
 void v1.0

Do absolutely nothing, and return absolutely nothing.
 Provides
void
 ensureboolean v1.0

Convert
x
into a Boolean value. Provides
ensureboolean
 letf* v1.0

Given a list of
bindings
whose keys are places and whose values are forms, set them for the duration ofbody
, but restore their values (as visible upon evaluation of this macro) upon completion. The restoration is ensured withunwindprotect
. Provides
letf*
 Requires
 zip, appendf
 let1 v1.0

Bind VAR to VAL within BODY. Equivalent to LET with one binding.
 Provides
let1
 defaccessor v1.0

Define the function named
name
just as with a normaldefun
. Also define the setter(setf name)
. The form to be set (i.e., the place) should be wrapped in the local macroaccesses
. For example,CLUSER> (let ((x 0)) (defaccessor savedx () (accesses x))) SAVEDX (SETF SAVEDX) CLUSER> (savedx) 0 CLUSER> (setf (savedx) 5) 5 CLUSER> (savedx) 5
 Provides
defaccessor
,accesses
 Requires
 withgensyms, parsebody
 imaginaryi v1.0

The imaginary number
i = sqrt(1)
. Provides
imaginaryi
,ii
 exponentiale v1.0

The exponential number
e = 2.71828...
. Provides
exponentiale
,ee
 until v1.0

Executes
body
untilexpression
is true. Provides
until
 while v1.0

Executes
body
whileexpression
is true. Provides
while
 Requires
 until
 alisttohashtable v1.0

Create a hash table populated with
kvpairs
. Provides
alisttohashtable
 hashtablekeyexistsp v1.0

Does
key
exist inhashtable
? Provides
hashtablekeyexistsp
 dohash v1.0

Iterate over the hash table
table
, executingbody
, withkey
andvalue
bound to the keys and values of the hash table respectively. Returnresult
from the iteration form. Provides
dohash
 reseedrandomstate v1.0

Reseed the random state use by the random number generator.
 Provides
reseedrandomstate
 randombetween v1.0

Generate a random integer between
a
andb
, inclusive. Provides
randombetween
 emptyp v1.0

Determine if
object
is empty. Provides
emptyp
 Requires
 nonzerop
 singletonp v1.0

Determine if
object
is a singleton object. Provides
singletonp
 recons v1.0

Reuse the cons cell
oldcons
, replacing its CAR witha
and CDR withb
. Provides
recons
 copycons v1.0

Copy the cons cell
c
. Provides
copycons
 coercetocondition v1.0

This function implements the semantics of CL condition designators. It makes a condition, given a
datum
(which may be a symbol, format control, or condition) and a list of argumentsargs
. See CLHS 9.1.2.1 for more specifics.defaulttype
is the type of objects that should be constructed whendatum
is a format control.supertype
is a type that should be a supertype of the types of all conditions returned by this function. Provides
coercetocondition
 truefalse v1.0

true
andfalse
synonyms fort
andnil
. Provides
true
,false
 yesno v1.0

Always return
t
ornil
. Equivalent to(constantly t)
and(constantly nil)
. Provides
yes
,no
 streamdirection v1.0

Return the direction of the stream
stream
::input
,:output
, or:io
. Provides
streamdirection
 makenullstream v1.0

Null input and output stream constructors.
 Provides
makenullinputstream
,makenulloutputstream
,makenullstream
 matchingnullstream v1.0

Return a null stream whose direction matches
stream
. Provides
matchingnullstream
 Requires
 makenullstream, streamdirection
 withignoredstreams v1.0

Ignore any input or output to any of the streams denoted by the symbols
streams
in the codebody
. Provides
withignoredstreams
 Requires
 matchingnullstream
 quietly v1.0

Quietly execute
body
, suppressing all output. Provides
quietly
 Requires
 withignoredstreams
 skipif v1.0

Given a character predicate
charpredicate
, read past all of the characters of the character streamstream
which satisfy that predicate. Optional argumentseoferrorp
,eofvalue
, andrecursivep
are the same as inreadchar
. Provides
skipif
 skip v1.0

Read past all of the characters matching
char
in the character streamstream
. Optional argumentseoferrorp
,eofvalue
, andrecursivep
are the same as inreadchar
. Provides
skip
 Requires
 skipif
 syntaxbind v1.0

Set
*readtable*
to a copy ofreadtableexpression
and modify the copy. Becausecl:load
andcl:compilefile
bind*readtable*
, this effectively gives a file local readtable in the same waycl:inpackage
gives a file local binding to*package*
. Example call:(syntaxbind *convenientreadtable* (#\# #\@) 'sendlinetochannel #\! 'notreader)
Sets
#!
to a nonterminating macro character. Use(#!)
to set it to a terminating macro character. A nullreadtableexpression
creates a readtable with standard Common Lisp syntax then applies the character bindings. Provides
syntaxbind
 splitsequence v1.0

Split sequences into a list of subsequences based off of a delimiter or function.
 Provides
splitsequence
,splitsequenceif
,splitsequenceifnot
 defineconstant v1.0

Ensures that the global variable named by
name
is a constant with a value that is equal undertest
to the result of evaluatinginitialvalue
.test
is a function designator that defaults toeql
. Ifdocumentation
is given, it becomes the documentation string of the constant.Signals an error if
name
is already a bound nonconstant variable.Signals an error if
name
is already a constant variable whose value is not equal undertest
to result of evaluatinginitialvalue
. Provides
defineconstant
 iflet v1.0

Creates new variable bindings, and conditionally executes either
thenform
orelseform
.elseform
defaults tonil
.bindings
must be either single binding of the form:(variable initialform)
or a list of bindings of the form:
((variable1 initialform1) (variable2 initialform2) ... (variablen initialformn))
All initialforms are executed sequentially in the specified order. Then all the variables are bound to the corresponding values.
If all variables were bound to true values, the
thenform
is executed with the bindings in effect, otherwise theelseform
is executed with the bindings in effect. Provides
iflet
 whenlet v1.0

Creates new variable bindings, and conditionally executes a series of forms.
 Provides
whenlet
,whenlet*
 stringdesignator v1.0

A string designator type. A string designator is either a string, a symbol, or a character.
 Provides
stringdesignator
 requiredargument v1.0

Signals an error for a missing argument of
name
. Intended for use as an initialization form for structure and classslots, and a default value for required keyword arguments. Provides
requiredargument
 simplestylewarning v1.0

 Provides
simplestylewarning
 simplereadererror v1.0

 Provides
simplereadererror
 simpleparseerror v1.0

 Provides
simpleparseerror
 simpleprogramerror v1.0

 Provides
simpleprogramerror
 ignoresomeconditions v1.0

Similar to
cl:ignoreerrors
but the (unevaluated)conditions
list determines which specific conditions are to be ignored. Provides
ignoresomeconditions
 unwindprotectcase v1.0

Like
cl:unwindprotect
, but you can specify the circumstances that the cleanupclauses
are run.clauses ::= (:NORMAL form*)*  (:ABORT form*)*  (:ALWAYS form*)*
Clauses can be given in any order, and more than one clause can be given for each circumstance. The clauses whose denoted circumstance occured, are executed in the order the clauses appear.
abortflag
is the name of a variable that will be bound tot
inclauses
if theprotectedform
aborted preemptively, and tonil
otherwise.Examples:
(unwindprotectcase () (protectedform) (:normal (format t "This is only evaluated if PROTECTEDFORM executed normally.~%")) (:abort (format t "This is only evaluated if PROTECTEDFORM aborted preemptively.~%")) (:always (format t "This is evaluated in either case.~%"))) (unwindprotectcase (abortedp) (protectedform) (:always (performcleanupif abortedp)))
 Provides
unwindprotectcase
 copyhashtable v1.0

Returns a copy of hash table
table
, with the same keys and values as thetable
. The copy has the same properties as the original, unless overridden by the keyword arguments.Before each of the original values is set into the new hashtable,
key
is invoked on the value. Askey
defaults tocl:identity
, a shallow copy is returned by default. Provides
copyhashtable
 maphashkeys v1.0

Like
maphash
, but callsfunction
with each key in the hash tabletable
. Provides
maphashkeys
 maphashvalues v1.0

Like
maphash
, but callsfunction
with each value in the hash tabletable
. Provides
maphashvalues
 hashtablekeys v1.0

Returns a list containing the keys of hash table
table
. Provides
hashtablekeys
 Requires
 maphashkeys
 hashtablevalues v1.0

Returns a list containing the values of hash table
table
. Provides
hashtablevalues
 Requires
 maphashvalues
 hashtablealist v1.0

Returns an association list containing the keys and values of hash table
table
. Provides
hashtablealist
 hashtableplist v1.0

Returns a property list containing the keys and values of hash table
table
. Provides
hashtableplist
 alisthashtable v1.0

Returns a hash table containing the keys and values of the association list
alist
. Hash table is initialized using thehashtableinitargs
. Provides
alisthashtable
 plisthashtable v1.0

Returns a hash table containing the keys and values of the property list
plist
. Hash table is initialized using thehashtableinitargs
. Provides
plisthashtable
 ensuregethash v1.0

Like
gethash
, but ifkey
is not found in thehashtable
saves thedefault
under key before returning it. Secondary return value is true if key was already in the table. Provides
ensuregethash
 ensuresymbol v1.0

Returns a symbol with name designated by
name
, accessible in package designated bypackage
. If symbol is not already accessible inpackage
, it is interned there. Returns a secondary value reflecting the status of the symbol in the package, which matches the secondary return value ofintern
.Example:
(ensuresymbol :cons :cl) => cl:cons, :external
 Provides
ensuresymbol
 formatsymbol v1.0

Constructs a string by applying
arguments
to string designatorcontrol
as if byformat
withinwithstandardiosyntax
, and then creates a symbol named by that string.If
package
isnil
, returns an uninterned symbol, if package ist
, returns a symbol interned in the current package, and otherwise returns a symbol interned in the package designated bypackage
. Provides
formatsymbol
 makekeyword v1.0

Interns the string designated by
name
in thekeyword
package. Provides
makekeyword
 makegensym v1.0

If
name
is a nonnegative integer, callsgensym
using it. Otherwisename
must be a string designator, in which case callsgensym
using the designated string as the argument. Provides
makegensym
 makegensymlist v1.0

Returns a list of
length
gensyms, each generated as if with a call tomakegensym
, using the second (optional, defaulting to"G"
) argument. Provides
makegensymlist
 symbolicate v1.0

Concatenate together the names of some strings and symbols, producing a symbol in the current package.
 Provides
symbolicate
 withgensyms v1.0

Binds each variable named by a symbol in
names
to a unique symbol aroundforms
. Each ofnames
must either be either a symbol, or of the form:(symbol stringdesignator)
Bare symbols appearing in
names
are equivalent to:(symbol symbol)
The stringdesignator is used as the argument to
gensym
when constructing the unique symbol the named variable will be bound to. Provides
withgensyms
,withuniquenames
 Requires
 stringdesignator
 onceonly v1.0

Evaluates
forms
with symbols specified inspecs
rebound to temporary variables, ensuring that each initform is evaluated only once.Each of
specs
must either be a symbol naming the variable to be rebound, or of the form:(symbol initform)
Bare symbols in
specs
are equivalent to(symbol symbol)
Example:
(defmacro cons1 (x) (onceonly (x) `(cons ,x ,x))) (let ((y 0)) (cons1 (incf y))) => (1 . 1)
 Provides
onceonly
 Requires
 makegensymlist
 parsebody v1.0

Parses
body
into(values remainingforms declarations docstring)
. Documentation strings are recognized only ifdocumentation
is true. Syntax errors in body are signalled andwhole
is used in the signal arguments when given. Provides
parsebody
 parseordinarylambdalist v1.0

Parses an ordinary lambdalist, returning as multiple values:
Required parameters.
Optional parameter specifications, normalized into form:
(name init suppliedp)
Name of the rest parameter, or
nil
.Keyword parameter specifications, normalized into form:
((keywordname name) init suppliedp)
Boolean indicating
&allowotherkeys
presence.&aux
parameter specifications, normalized into form
(name init)
. Existence of
&key
in thelambdalist
.
Signals a
programerror
iflambdalist
is malformed. Provides
parseordinarylambdalist
 Requires
 simpleprogramerror, ensurelist, makekeyword
 destructuringcase v1.0

destructuringcase
, 'destructuringccaseand 'destructuringecase
are a combination ofcase
anddestructuringbind
.keyform
must evaluate to afcons
.Clauses are of the form:
((casekeys . destructuringlambdalist) form*)
The clause whose
casekeys
matchescar
ofkey
, as if bycase
,ccase
, orecase
, is selected, andform
s are then executed withcdr
ofkey
is destructured and Bound By Thedestructuringlambdalist
.Example:
(defun dcase (x) (destructuringcase x ((:foo a b) (format nil "foo: ~S, ~S" a b)) ((:bar &key a b) (format nil "bar, ~S, ~S" a b)) (((:alt1 :alt2) a) (format nil "alt: ~S" a)) ((t &rest rest) (format nil "unknown: ~S" rest)))) (dcase (list :foo 1 2)) ; => "foo: 1, 2" (dcase (list :bar :a 1 :b 2)) ; => "bar: 1, 2" (dcase (list :alt1 1)) ; => "alt: 1" (dcase (list :alt2 2)) ; => "alt: 2" (dcase (list :quux 1 2 3)) ; => "unknown: 1, 2, 3" (defun decase (x) (destructuringcase x ((:foo a b) (format nil "foo: ~S, ~S" a b)) ((:bar &key a b) (format nil "bar, ~S, ~S" a b)) (((:alt1 :alt2) a) (format nil "alt: ~S" a)))) (decase (list :foo 1 2)) ; => "foo: 1, 2" (decase (list :bar :a 1 :b 2)) ; => "bar: 1, 2" (decase (list :alt1 1)) ; => "alt: 1" (decase (list :alt2 2)) ; => "alt: 2" (decase (list :quux 1 2 3)) ; = error
 Provides
destructuringcase
,destructuringccase
,destructuringecase
 Requires
 onceonly
 extractfunctionname v1.0

Useful for macros that want to mimic the functional interface for functions like
#'eq
and'eq
. Provides
extractfunctionname
 switch v1.0

Dispatch to different branches of code based off of the value of an expression.
 Provides
switch
,eswitch
,cswitch
 Requires
 withgensyms, extractfunctionname
 whichever v1.0

Evaluates exactly one of
possibilities
, chosen at random. Provides
whichever
 Requires
 withgensyms
 xor v1.0

Evaluates its arguments one at a time, from left to right. If more then one argument evaluates to a true value no further
datums
are evaluated, andnil
is returned as both primary and secondary value. If exactly one argument evaluates to true, its value is returned as the primary value after all the arguments have been evaluated, andt
is returned as the secondary value. If no arguments evaluate to truenil
is retuned as primary, andt
as secondary value. Provides
xor
 Requires
 withgensyms
 nthvalueor v1.0

Evaluates
form
arguments one at a time, until thenthvalue
returned by one of the forms is true. It then returns all the values returned by evaluating that form. If none of the forms return a true nth value, this form returnsnil
. Provides
nthvalueor
 Requires
 withgensyms, onceonly
 multiplevalueprog2 v1.0

Evaluates
firstform
, thensecondform
, and thenforms
. Yields as its value all the value returned bysecondform
. Provides
multiplevalueprog2
 featurep v1.0

Returns
t
if the argument matches the state of the*features*
list andnil
if it does not.featureexpression
can be any atom or list acceptable to the reader macros#+
and#
. Provides
featurep
 Requires
 switch
 ensurefunction v1.0

Returns the function designated by
functiondesignator
: iffunctiondesignator
is a function, it is returned, otherwise it must be a function name and itsfdefinition
is returned. Provides
ensurefunction
 ensurefunctionf v1.0

Multipleplace modify macro for
ensurefunction
: ensures that each ofplaces
contains a function. Provides
ensurefunctionf
 Requires
 ensurefunction
 disjoin v1.0

Returns a function that applies each of
predicate
andmorepredicate
functions in turn to its arguments, returning the primary value of the first predicate that returns true, without calling the remaining predicates. If none of the predicates returns true,nil
is returned. Provides
disjoin
 Requires
 ensurefunction
 conjoin v1.0

Returns a function that applies each of
predicate
andmorepredicate
functions in turn to its arguments, returningnil
if any of the predicates returns false, without calling the remaining predicates. If none of the predicates returns false, returns the primary value of the last predicate. Provides
conjoin
 compose v1.0

Returns a function composed of
function
andmorefunctions
that applies its ; arguments to to each in turn, starting from the rightmost ofmorefunctions
, and then calling the next one with the primary value of the last. Provides
compose
 Requires
 makegensymlist, ensurefunction
 multiplevaluecompose v1.0

Returns a function composed of
function
andmorefunctions
that applies its arguments to each in turn, starting from the rightmost ofmorefunctions
, and then calling the next one with all the return values of the last. Provides
multiplevaluecompose
 Requires
 makegensymlist, ensurefunction
 curry v1.0

Returns a function that applies
arguments
and the arguments it is called with tofunction
. Provides
curry
 Requires
 makegensymlist, ensurefunction
 rcurry v1.0

Returns a function that applies the arguments it is called with and
arguments
tofunction
. Provides
rcurry
 Requires
 ensurefunction
 namedlambda v1.0

Expands into a lambdaexpression within whose
body
name
denotes the corresponding function. Provides
namedlambda
 arraybounds v1.0

Types related to array bounds.
 Provides
arrayindex
,arraylength
 subintervalnumerictypes v1.0

Contains 'subinterval numeric types'. Majority of the implementation of CDR5.
 Provides
negativedoublefloat
,negativefixnump
,negativefloat
,negativefloatp
,negativelongfloat
,negativelongfloatp
,negativerational
,negativerationalp
,negativereal
,negativesinglefloatp
,nonnegativedoublefloat
,nonnegativedoublefloatp
,nonnegativefixnum
,nonnegativefixnump
,nonnegativefloat
,nonnegativefloatp
,nonnegativeintegerp
,nonnegativelongfloat
,nonnegativerational
,nonnegativerealp
,nonnegativeshortfloatp
,nonnegativesinglefloat
,nonnegativesinglefloatp
,nonpositivedoublefloat
,nonpositivedoublefloatp
,nonpositivefixnum
,nonpositivefixnump
,nonpositivefloat
,nonpositivefloatp
,nonpositiveinteger
,nonpositiverational
,nonpositivereal
,nonpositiverealp
,nonpositiveshortfloat
,nonpositiveshortfloatp
,nonpositivesinglefloatp
,positivedoublefloat
,positivedoublefloatp
,positivefixnum
,positivefixnump
,positivefloat
,positivefloatp
,positiveinteger
,positiverational
,positivereal
,positiverealp
,positiveshortfloat
,positiveshortfloatp
,positivesinglefloat
,positivesinglefloatp
,negativedoublefloatp
,negativefixnum
,negativeinteger
,negativeintegerp
,negativerealp
,negativeshortfloat
,negativeshortfloatp
,negativesinglefloat
,nonnegativeinteger
,nonnegativelongfloatp
,nonnegativerationalp
,nonnegativereal
,nonnegativeshortfloat
,nonpositiveintegerp
,nonpositivelongfloat
,nonpositivelongfloatp
,nonpositiverationalp
,nonpositivesinglefloat
,positiveintegerp
,positivelongfloat
,positivelongfloatp
,positiverationalp
 Requires
 formatsymbol
 oftype v1.0

Returns a function of one argument, which returns true when its argument is of TYPE.
 Provides
oftype
 Requires
 withgensyms
 type= v1.0

Returns a primary value of
t
istype1
andtype2
are the same type, and a secondary value that is true is the type equality could be reliably determined: primary value ofnil
and secondary value oft
indicates that the types are not equivalent. Provides
type=
 coercef v1.0

Modifymacro for
coerce
. Provides
coercef
 copyarray v1.0

Returns an undisplaced copy of
array
, with samefillpointer
and adjustability (if any) as the original, unless overridden by the keyword arguments. Provides
copyarray
 alistplist v1.0

Convert between alists and plists.
 Provides
alistplist
,plistalist
 Requires
 safeendp
 assocvalue v1.0

Getters and setters for
assoc
andrassoc
values. Provides
assocvalue
,rassocvalue
 Requires
 withgensyms
 doplist v1.0

Iterates over elements of
plist
.body
can be preceded by declarations, and is like atagbody
.return
may be used to terminate the iteration early. Ifreturn
is not used, returnsvalues
. Provides
doplist
 Requires
 parsebody, withgensyms
 appendf v1.0

Modifymacro for
append
. Appendslists
to the place designated by the first argument. Provides
appendf
 nconcf v1.0

Modifymacro for
nconc
. Concatenateslists
to place designated by the first argument. Provides
nconcf
 unionf v1.0

Modifymacro for
union
. Saves the union oflist
and the contents of the place designated by the first argument to the designated place. Provides
unionf
 nunionf v1.0

Modifymacro for
nunion
. Saves the union oflist
and the contents of the place designated by the first argument to the designated place. May modify either argument. Provides
nunionf
 reversef v1.0

Modifymacro for
reverse
. Copies and reverses the list stored in the given place and saves back the result into the place. Provides
reversef
 nreversef v1.0

Modifymacro for
nreverse
. Reverses the list stored in the given place by destructively modifying it and saves back the result into the place. Provides
nreversef
 circularlist v1.0

Creation and detection of circular lists.
 Provides
circularlist
,circularlistp
,makecircularlist
 circulartreep v1.0

Returns true if
object
is a circular tree,nil
otherwise. Provides
circulartreep
 properlistp v1.0

Returns true if
object
is a proper list. Provides
properlistp
 properlist v1.0

Type designator for proper lists. Implemented as a
satisfies
type, hence not recommended for performance intensive use. Main usefulness as a type designator of the expected type in atypeerror
. Provides
properlist
 Requires
 properlistp
 properlistlength/lastcar v1.0

Compute the length of a proper list, and the last CAR of a list quickly.
 Provides
properlistlength
,lastcar
 Requires
 circularlist, safeendp
 ensurecar v1.0

If
thing
is acons
, itscar
is returned. Otherwisething
is returned. Provides
ensurecar
 ensurecons v1.0

If
cons
is a cons, it is returned. Otherwise returns a fresh cons withcons
in the car, andnil
in the cdr. Provides
ensurecons
 ensurelist v1.0

If
list
is a list, it is returned. Otherwise returns the list designated bylist
. Provides
ensurelist
 removefromplist v1.0

Destructive and nondestructive functions to remove items from a plist, as well as associated modify macros.
 Provides
removefromplist
,deletefromplist
,removefromplistf
,deletefromplistf
,sans
 mappend v1.0

Applies
function
to respective element(s) of eachlist
, appending all the all the result list to a single list.function
must return a list. Provides
mappend
 setp v1.0

Returns true if
object
is a list that denotes a set,nil
otherwise. A list denotes a set if each element of the list is unique underkey
andtest
. Provides
setp
 setequal v1.0

Returns true if every element of
list1
matches some element oflist2
and every element oflist2
matches some element oflist1
. Otherwise returns false. Provides
setequal
 mapproduct v1.0

Returns a list containing the results of calling
function
with one argument fromlist
, and one from each ofmorelists
for each combination of arguments. In other words, returns the product oflist
andmorelists
usingfunction
.Example:
(mapproduct 'list '(1 2) '(3 4) '(5 6)) => ((1 3 5) (1 3 6) (1 4 5) (1 4 6) (2 3 5) (2 3 6) (2 4 5) (2 4 6))
 Provides
mapproduct
 Requires
 ensurefunction, curry, mappend
 withopenfile* v1.0

Just like
withopenfile
, butnil
values in the keyword arguments mean to use the default value specified foropen
. Provides
withopenfile*
 Requires
 onceonly
 withinputfromfile v1.0

Evaluate
body
withstreamname
to an input stream on the filefilename
.args
is sent as is to the call toopen
exceptexternalformat
, which is only sent towithopenfile
when it's notnil
. Provides
withinputfromfile
 Requires
 withopenfile*
 withoutputtofile v1.0

Evaluate
body
withstreamname
to an output stream on the filefilename
.args
is sent as is to the call toopen
exceptexternalformat
, which is only sent towithopenfile
when it's notnil
. Provides
withoutputtofile
 Requires
 withopenfile*
 readfileintostring v1.0

Return the contents of the file denoted by
pathname
as a fresh string.The
externalformat
parameter will be passed directly towithopenfile
unless it'snil
, which means the system default. Provides
readfileintostring
 Requires
 withinputfromfile
 writestringintofile v1.0

Write
string
topathname
.The
externalformat
parameter will be passed directly towithopenfile
unless it'snil
, which means the system default. Provides
writestringintofile
 Requires
 withoutputtofile
 readfileintobytevector v1.0

Read
pathname
into a freshly allocated(unsignedbyte 8)
vector. Provides
readfileintobytevector
 Requires
 withinputfromfile
 writebytevectorintofile v1.0

Write
bytes
topathname
. Provides
writebytevectorintofile
 Requires
 withoutputtofile
 copyfile v1.0

Copy a file from
from
toto
. Provides
copyfile
 Requires
 copystream, withoutputtofile, withinputfromfile
 copystream v1.0

Reads data from
input
and writes it tooutput
. Bothinput
andoutput
must be streams, they will be passed toreadsequence
andwritesequence
and must have compatibleelementtype
s. Provides
copystream
 Requires
 subintervalnumerictypes
 sequenceoflengthp v1.0

 Provides
sequenceoflengthp
 Requires
 arraybounds
 rotate v1.0

Returns a sequence of the same type as
sequence
, with the elements ofsequence
rotated byn
:n
elements are moved from the end of the sequence to the front ifn
is positive, andn
elements moved from the front to the end ifn
is negative.sequence
must be a proper sequence.n
must be an integer, defaulting to1
.If absolute value of
n
is greater then the length of the sequence, the results are identical to callingrotate
with(* (signum n) (mod n (length sequence))).
Note: the original sequence may be destructively altered, and result sequence may share structure with it.
 Provides
rotate
 Requires
 properlistlength/lastcar
 shuffle v1.0

Returns a random permutation of
sequence
bounded bystart
andend
. Original sequece may be destructively modified, and share storage with the original one. Signals an error ifsequence
is not a proper sequence. Provides
shuffle
 Requires
 properlistlength/lastcar
 randomelt v1.0

Returns a random element from
sequence
bounded bystart
andend
. Signals an error if thesequence
is not a proper nonempty sequence, or ifend
andstart
are not proper bounding index designators forsequence
. Provides
randomelt
 Requires
 properlistlength/lastcar
 removef v1.0

Modifymacro for
remove
. Sets place designated by the first argument to the result of callingremove
withitem
, place, and thekeywordarguments
. Provides
removef
 deletef v1.0

Modifymacro for
delete
. Sets place designated by the first argument to the result of callingdelete
withitem
, place, and thekeywordarguments
. Provides
deletef
 propersequence v1.0

Type designator for proper sequences, that is proper lists and sequences that are not lists.
 Provides
propersequence
 Requires
 properlist
 length= v1.0

Takes any number of sequences or integers in any order. Returns true iff the length of all the sequences and the integers are equal.
Hint: there's a compiler macro that expands into more efficient code if the first argument is a literal integer.
 Provides
length=
 Requires
 withgensyms, sequenceoflengthp, arraybounds
 copysequence v1.0

Returns a fresh sequence of
type
, which has the same elements assequence
. Provides
copysequence
 firstelt v1.0

Getter and setter for the first element of a sequence.
 Provides
firstelt
 Requires
 emptyp
 lastelt v1.0

Getter and setter for the last element of a sequence.
 Provides
lastelt
 Requires
 properlistlength/lastcar, emptyp, propersequence
 startswithsubseq v1.0

Test whether the first elements of SEQUENCE are the same (as per TEST) as the elements of PREFIX.
If RETURNSUFFIX is T the functions returns, as a second value, a displaced array pointing to the sequence after PREFIX.
 Provides
startswithsubseq
 Requires
 removefromplist
 endswithsubseq v1.0

Test whether
sequence
ends withsuffix
. In other words: return true if the last(length suffix
) elements ofsequence
are equal tosuffix
. Provides
endswithsubseq
 startswith v1.0

Returns true if
sequence
is a sequence whose first element iseql
toobject
. Returnsnil
if thesequence
is not a sequence or is an empty sequence. Provides
startswith
 endswith v1.0

Returns true if
sequence
is a sequence whose last element iseql
toobject
. Returnsnil
if thesequence
is not a sequence or is an empty sequence. Signals an error ifsequence
is an improper list. Provides
endswith
 Requires
 properlistlength/lastcar
 mapcombinations v1.0

Calls
function
with each combination oflength
constructable from the elements of the subsequence ofsequence
delimited bystart
andend
.start
defaults to0
,end
to length ofsequence
, andlength
to the length of the delimited subsequence. (So unlesslength
is specified there is only a single combination, which has the same elements as the delimited subsequence.) Ifcopy
is true (the default) each combination is freshly allocated. Ifcopy
is false all combinations areeq
to each other, in which case consequences are specified if a combination is modified byfunction
. Provides
mapcombinations
 Requires
 ensurefunction
 mappermutations v1.0

Calls function with each permutation of
length
constructable from the subsequence ofsequence
delimited bystart
andend
.start
defaults to0
,end
to length of the sequence, andlength
to the length of the delimited subsequence. Provides
mappermutations
 Requires
 mapcombinations
 mapderangements v1.0

Calls
function
with each derangement of the subsequence ofsequence
denoted by the bounding index designatorsstart
andend
. Derangement is a permutation of the sequence where no element remains in place.sequence
is not modified, but individual derangements areeq
to each other. Consequences are unspecified if callingfunction
modifies either the derangement orsequence
. Provides
mapderangements
 extremum v1.0

Returns the element of
sequence
that would appear first if the subsequence bounded bystart
andend
was sorted usingpredicate
andkey
.extremum
determines the relationship between two elements ofsequence
by using thepredicate
function.predicate
should return true if and only if the first argument is strictly less than the second one (in some appropriate sense). Two argumentsx
andy
are considered to be equal if(funcall predicate x y)
and(funcall predicate y x)
are both false.The arguments to the
predicate
function are computed from elements ofsequence
using thekey
function, if supplied. Ifkey
is not supplied or isnil
, the sequence element itself is used.If
sequence
is empty,nil
is returned. Provides
extremum
 Requires
 ensurefunction
 clamp v1.0

Clamps the
number
into [min
,max
] range. Returnsmin
ifnumber
is lesser thenmin
andmax
ifnumber
is greater thenmax
, otherwise returnsnumber
. Provides
clamp
 gaussianrandom v1.0

Returns two gaussian random double floats as the primary and secondary value, optionally constrained by
min
andmax
. Gaussian random numbers form a standard normal distribution around0.0d0
.Sufficiently positive
min
or negativemax
will cause the algorithm used to take a very long time. Ifmin
is positive it should be close to zero, and similarly ifmax
is negative it should be close to zero. Provides
gaussianrandom
 iota v1.0

Return a list of
n
numbers, starting fromstart
(with numeric contagion fromstep
applied), each consequtive number being the sum of the previous one andstep
.start
defaults to0
andstep
to1
.Examples:
(iota 4) => (0 1 2 3) (iota 3 :start 1 :step 1.0) => (1.0 2.0 3.0) (iota 3 :start 1 :step 1/2) => (1 3/2 2)
 Provides
iota
 mapiota v1.0

Calls
function
withn
numbers, starting fromstart
(with numeric contagion fromstep
applied), each consequtive number being the sum of the previous one andstep
.start
defaults to0
andstep
to1
. Returnsn
.Examples:
(mapiota #'print 3 :start 1 :step 1.0) => 3 ;;; 1.0 ;;; 2.0 ;;; 3.0
 Provides
mapiota
 lerp v1.0

Returns the result of linear interpolation between
a
andb
, using the interpolation coefficientv
. Provides
lerp
 mean v1.0

Returns the mean of
sample
.sample
must be a sequence of numbers. Provides
mean
 median v1.0

Returns median of
sample
.sample
must be a sequence of real numbers. Provides
median
 Requires
 copysequence
 variance v1.0

Variance of
sample
. Returns the biased variance ifbiased
is true (the default), and the unbiased estimator of variance ifbiased
is false.sample
must be a sequence of numbers. Provides
variance
 Requires
 mean
 standarddeviation v1.0

Standard deviation of
sample
. Returns the biased standard deviation ifbiased
is true (the default), and the square root of the unbiased estimator for variance ifbiased
is false (which is not the same as the unbiased estimator for standard deviation).sample
must be a sequence of numbers. Provides
standarddeviation
 Requires
 variance
 maxf v1.0

Modifymacro for
max
. Sets place designated by the first argument to the maximum of its original value andnumbers
. Provides
maxf
 minf v1.0

Modifymacro for
min
. Sets place designated by the first argument to the minimum of its original value andnumbers
. Provides
minf
 subfactorial v1.0

Subfactorial of the nonnegative integer
n
. Provides
subfactorial
 countpermutations v1.0

Number of
k
element permutations for a sequence ofn
objects.k
defaults ton
 Provides
countpermutations
 Requires
 rangeproduct