Permalink
Fetching contributors…
Cannot retrieve contributors at this time
215 lines (176 sloc) 5.82 KB
% Copyright (C) 2008, 2009, 2010, 2011, 2012, 2014 Bert Burgemeister
%
% Permission is granted to copy, distribute and/or modify this
% document under the terms of the GNU Free Documentation License,
% Version 1.2; with no Invariant Sections, no Front-Cover Texts and
% no Back-Cover Texts. For details see file COPYING.
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Arrays}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\label{section:Arrays}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{Predicates}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{LIST}{1cm}
\IT{\arrGOO{%
(\FU*{ARRAYP} \VAR{ foo})\\
(\FU*{VECTORP} \VAR{ foo})\\
(\FU*{SIMPLE-VECTOR-P} \VAR{ foo})\\
(\FU*{BIT-VECTOR-P} \VAR{ foo})\\
(\FU*{SIMPLE-BIT-VECTOR-P} \VAR{ foo})}{.}}
{
\retval{\T} if \VAR{foo} is of indicated type.
}
\IT{\arrGOO{(\FU*{ADJUSTABLE-ARRAY-P} \VAR{ array})\\
(\FU*{ARRAY-HAS-FILL-POINTER-P} \VAR{ array})}{.}}
{
\retval{\T} if \VAR{array} is adjustable/has a fill pointer,
respectively.
}
\IT{(\FU*{ARRAY-IN-BOUNDS-P} \VAR{array} \Op{\VAR{subscripts}})}
{
Return \retval{\T} if \VAR{subscripts} are in \VAR{array}'s bounds.
}
% No default subscripts in standard.
\end{LIST}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{Array Functions}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{LIST}{1cm}
\IT{(\xorGOO{%
\FU*{MAKE-ARRAY}\VAR{ dimension-sizes }
\OP{\kwd{:adjustable} \VAR{ bool}\DF{\NIL}}\\
\FU*{ADJUST-ARRAY } \DES{\VAR{array}}
\VAR{ dimension-sizes}}{\}}
\orGOO{\kwd{:element-type} \VAR{ type}\DF{\T}\\
\kwd{:fill-pointer } \Goo{\VAR{num}\XOR\VAR{bool}}\DF{\NIL}\\
\xorGOO{\kwd{:initial-element} \VAR{ obj}\\
\kwd{:initial-contents} \VAR{ tree-or-array}\\
\kwd{:displaced-to } \VAR{array}\DF{\NIL}\text{ }
\Op{\kwd{:displaced-index-offset } \VAR{i}\DF{\LIT{0}}}}{.}}{\}})}
{
Return fresh, or readjust, respectively, \retval{vector} or \retval{array}.
}
\IT{(\FU*{AREF} \VAR{array} \OP{\VAR{subscripts}})}
{
Return
\retval{array element} pointed to by \VAR{subscripts}. \kwd{setf}able.
}
% No subscripts means sole element of rank zero array.
\IT{(\FU*{ROW-MAJOR-AREF} \VAR{array} \VAR{i})}
{
Return \retval{\VAR{i}th element} of \VAR{array} in row-major
order. \kwd{setf}able.
}
\IT{(\FU*{ARRAY-ROW-MAJOR-INDEX} \VAR{array} \Op{\VAR{subscripts}})}
{
\retval{Index} in row-major order of the element denoted by \VAR{subscripts}.
}
\IT{(\FU*{ARRAY-DIMENSIONS} \VAR{array})}
{
\retval{List} containing the lengths of \VAR{array}'s dimensions.
}
\IT{(\FU*{ARRAY-DIMENSION} \VAR{array} \VAR{i})}
{
\retval{Length of \VAR{i}th dimension} of \VAR{array}.
}
\IT{(\FU*{ARRAY-TOTAL-SIZE} \VAR{array})}
{
\retval{Number of elements} in \VAR{array}.
}
\IT{(\FU*{ARRAY-RANK} \VAR{array})}
{
\retval{Number of dimensions} of \VAR{array}.
}
\IT{(\FU*{ARRAY-DISPLACEMENT} \VAR{array})}
{
\retval{Target array} and \retvalii{offset}.
}
\IT{\arrGOO{(\FU*{BIT} \VAR{ bit-array } \Op{\VAR{subscripts}})\\
(\FU*{SBIT} \VAR{ simple-bit-array } \Op{\VAR{subscripts}})}{.}}
{
Return \retval{element} of \VAR{bit-array} or of
\VAR{simple-bit-array}. \kwd{setf}\-able.
}
\IT{(\FU*{BIT-NOT} \DES{\VAR{bit-array}} \Op{\DES{\VAR{result-bit-array}}\DF{\NIL}})}
{
Return \retval{result} of bitwise negation of \VAR{bit-array}. If \VAR{result-bit-array} is \T, put
result in \VAR{bit-array}; if it is \NIL, make a new array for
result.
}
\IT{(\xorGOO{%
\FU*{BIT-EQV}\\
\FU*{BIT-AND}\\
\FU*{BIT-ANDC1}\\
\FU*{BIT-ANDC2}\\
\FU*{BIT-NAND}\\
\FU*{BIT-IOR}\\
\FU*{BIT-ORC1}\\
\FU*{BIT-ORC2}\\
\FU*{BIT-XOR}\\
\FU*{BIT-NOR}}{\}} \DES{\VAR{bit-array-a}} \VAR{bit-array-b}
\Op{\DES{\VAR{result-bit-array}}\DF{\NIL}})}
{
Return \retval{result} of bitwise logical operations
(cf.\ operations of \FU{boole}, page \pageref{section:Logic Functions}) on
\VAR{bit-array-a} and \VAR{bit-array-b}. If \VAR{result-bit-array} is \T, put result in
\VAR{bit-array-a}; if it is \NIL, make a new array for
result.
}
\IT{\CNS*{ARRAY-RANK-LIMIT}}
{
Upper bound of array rank; $\geq 8$.
}
\IT{\CNS*{ARRAY-DIMENSION-LIMIT}}
{
Upper bound of an array dimension; $\geq 1024$.
}
\IT{\CNS*{ARRAY-TOTAL-SIZE-LIMIT}}
{
Upper bound of array size; $\geq 1024$.
}
\end{LIST}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{Vector Functions}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Vectors can as well be manipulated by sequence functions; see
section~\ref{section:Sequences}.
\begin{LIST}{1cm}
\IT{(\FU*{VECTOR} \OPn{\VAR{foo}})}
{
Return fresh \retval{simple vector of \VAR{foo}s}.
}
% No default foo in standard.
\IT{(\FU*{SVREF} \VAR{vector} \VAR{i})}
{
\retval{Element \VAR{i}} of simple \VAR{vector}. \kwd{setf}able.
}
\IT{(\FU*{VECTOR-PUSH} \VAR{foo} \DES{\VAR{vector}})}
{
Return \retval{\NIL} if \VAR{vector}'s fill pointer equals size of
\VAR{vector}. Otherwise replace element of \VAR{vector} pointed to
by \retval{fill pointer} with \VAR{foo}; then increment fill
pointer.
}
\IT{(\FU*{VECTOR-PUSH-EXTEND} \VAR{foo} \DES{\VAR{vector}}
\Op{\VAR{num}})}
{
Replace element of \VAR{vector} pointed to by \retval{fill pointer} with
\VAR{foo}, then increment fill pointer. Extend \VAR{vector}'s size by
$\ge \VAR{num}$ if necessary.
}
\IT{(\FU*{VECTOR-POP} \DES{\VAR{vector}})}
{
Return \retval{element of \VAR{vector}} its fillpointer points to
after decrementation.
}
\IT{(\FU*{FILL-POINTER} \VAR{vector})}
{
\retval{Fill pointer} of \VAR{vector}. \kwd{setf}able.
}
\end{LIST}
%%% Local Variables:
%%% mode: latex
%%% TeX-master: "clqr"
%%% End: