There are 119 utilities.
 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
 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