\section{Selected Listing of XLISP-STAT Functions}
\subsection{Arithmetic and Logical Functions}
\begin{lispdoc}
\fdocitem{(+ \&rest numbers)}
Returns the sum of its arguments. With no args, returns 0. Vectorized.
\fdocitem{(- number \&rest more-numbers)}
Subtracts the second and all subsequent NUMBERs from the first. With one arg,
negates it. Vectorized.
\fdocitem{(* \&rest numbers)}
Returns the product of its arguments. With no args, returns 1. Vectorized.
\fdocitem{(/ number \&rest more-numbers)}
Divides the first NUMBER (element-wise) by each of the subsequent NUMBERS.
With one arg, returns its reciprocal. Vectorized.
\fdocitem{(\^~~ base-number power-number)}
Returns BASE-NUMBER raised to the power POWER-NUMBER. Vectorized.
\fdocitem{(** base-number power-number)}
Returns BASE-NUMBER raised to the power POWER-NUMBER. Vectorized.
\fdocitem{($<$ \&rest numbers)}
Returns T if NUMBERS are in strictly increasing order; NIL otherwise.
Vectorized.
\fdocitem{($<=$ \&rest numbers)}
Returns T if NUMBERS are in nondecreasing order; NIL otherwise. Vectorized.
\fdocitem{(= \&rest numbers)}
Returns T if NUMBERS are all equal; NIL otherwise. Vectorized.
\fdocitem{(/= \&rest numbers)}
Returns T if NUMBERS no two adjacent numbers are equal; NIL otherwise. Vectorized.
\fdocitem{($>=$ \&rest numbers)}
Returns T if NUMBERS are in nonincreasing order; NIL otherwise. Vectorized.
\fdocitem{($>$ \&rest numbers)}
Returns T if NUMBERS are in strictly decreasing order; NIL otherwise. Vectorized.
\fdocitem{(abs number)}
Returns the absolute value or modulus of NUMBER. Vectorized.
\fdocitem{(acos number)}
Returns the arc cosine of NUMBER. Vectorized.
\fdocitem{(asin number)}
Returns the arc sine of NUMBER. Vectorized.
\fdocitem{(atan number)}
Returns the arc tangent of NUMBER. Vectorized.
\fdocitem{(ceiling number)}
Returns the smallest integer(s) not less than or NUMBER. Vectorized.
\fdocitem{(complex realpart \&optional (imagpart 0))}
Returns a complex number with the given real and imaginary parts.
\fdocitem{(conjugate number)}
Returns the complex conjugate of NUMBER.
\fdocitem{(cos radians)}
Returns the cosine of RADIANS. Vectorized.
\fdocitem{(exp x)}
Calculates e raised to the power x, where e is the base of natural
logarithms. Vectorized.
\fdocitem{(expt base-number power-number)}
Returns BASE-NUMBER raised to the power POWER-NUMBER. Vectorized.
\fdocitem{(float number)}
Converts real number to a floating-point number. If NUMBER is
already a float, FLOAT simply returns NUMBER. Vectorized.
\fdocitem{(floor number)}
Returns the largest integer( not larger than the NUMBER. Vectorized.
\fdocitem{(imagpart number)}
Extracts the imaginary part of NUMBER.
\fdocitem{(log number)}
Returns the natural logarithm(s) of NUMBER. Vectorized.
\fdocitem{(log-gamma x)}
Returns the log gamma function of X. Vectorized.
\fdocitem{(max number \&rest more-numbers)}
Returns the greatest of its arguments. Vector reducing
\fdocitem{(min number \&rest more-numbers)}
Returns the least of its arguments. Vector reducing
\fdocitem{(phase number)}
Returns the angle part of the polar representation of a complex number.
For non-complex numbers, this is 0.
\fdocitem{(pmax \&rest items)}
Parallel maximum of ITEMS. Vectorized.
\fdocitem{(pmin \&rest items)}
Parallel minimum of ITEMS. Vectorized.
\fdocitem{(prod \&rest number-data)}
Returns the product of all the elements of its arguments. Returns 1 if there
are no arguments. Vector reducing.
\fdocitem{(random number)}
Generates a uniformly distributed pseudo-random number between zero (inclusive)
and NUMBER (exclusive). Vectorized.
\fdocitem{(realpart number)}
Extracts the real part of NUMBER.
\fdocitem{(rem x y)}
Returns the remainder of dividing x by y. Vectorized.
\fdocitem{(round number)}
Rounds NUMBER to nearest integer. Vectorized.
\fdocitem{(sin radians)}
Returns the sine of RADIANS. Vectorized.
\fdocitem{(sqrt number)}
Returns the square root of NUMBER. Vectorized.
\fdocitem{(sum \&rest number-data)}
Returns the sum of all the elements of its arguments. Returns 0 if there
are no arguments. Vector reducing.
\fdocitem{(tan radians)}
Returns the tangent of RADIANS. Vectorized.
\fdocitem{(truncate number)}
Returns real NUMBER as an integer, rounded toward 0. Vectorized.
\end{lispdoc}
\subsection{Constructing and Modifying Compound Data and Variables}
\begin{lispdoc}
\mdocitem{(def var form)}
VAR is not evaluated and must be a symbol. Assigns the value of FORM to
VAR and adds VAR to the list *VARIABLES* of def'ed variables. Returns VAR.
If VAR is already bound and the global variable *ASK-ON-REDEFINE*
is not nil then you are asked if you want to redefine the variable.
\fdocitem{(if-else first x y)}
Takes simple or compound data items FIRST, X and Y and returns result
of elementswise selecting from X if FIRST is not NIL and from Y
otherwise.
\fdocitem{(iseq n m)}
Returns a list of consecutive integers from n to m.
Examples:\\
(iseq 3 7) returns (3 4 5 6 7)\\
(iseq 3 -3) returns (3 2 1 0 -1 -2 -3)
\fdocitem{(list \&rest args)}
Returns a list of its arguments
\fdocitem{(repeat vals times)}
Repeats VALS. If TIMES is a number and VALS is a non-null, non-array atom, a list
of length TIMES with all elements eq to VALS is returned. If VALS is a list and
TIMES is a number then VALS is appended TIMES times. If TIMES is a list of numbers
then VALS must be a list of equal length and the simpler version of repeat is
mapped down the two lists.
Examples: \\
(repeat 2 5) returns (2 2 2 2 2)\\
(repeat '(1 2) 3) returns (1 2 1 2 1 2)\\
(repeat '(4 5 6) '(1 2 3)) returns (4 5 5 6 6 6)\\
(repeat '((4) (5 6)) '(2 3)) returns (4 4 5 6 5 6 5 6)
\fdocitem{(rseq a b num)}
Returns a list of NUM equally spaced points starting at A and ending at B.
\fdocitem{(select a \&rest indices)}
A can be a list or an array. If A is a list and INDICES is a single number
then the appropriate element of A is returned. If is a list and INDICES is
a list of numbers then the sublist of the corresponding elements is returned.
If A in an array then the number of INDICES must match the ARRAY-RANK of A.
If each index is a number then the appropriate array element is returned.
Otherwise the INDICES must all be lists of numbers and the corresponding
submatrix of A is returned. SELECT can be used in setf.
\fdocitem{(undef symbol)}
If SYMBOL is a defined variable it is unbound and removed from the list of
defined variables and returns SYMBOL.
\fdocitem{(vector \&rest items)}
Returns a vector with ITEMS as elements.
\fdocitem{(which x)}
X is an array or a list. Returns a list of the indices where X is not NIL.
\end{lispdoc}
\subsection{Basic Statistical Functions}
\label{Appendix.Statistical}
\begin{lispdoc}
\fdocitem{(bayes-model logpost mode \&key scale data derivstep (verbose t) (quick t) (print t))}
LOGPOST computes the logposterior density. It should return the
function, or a list of the function value and gradient, or a list of
the function value, gradient and Hessian. MODE is an initial guess for
the mode. SCALE and DERIVSTEP are used for numerical derivatives and
scaling. VERBOSE controls printing of iteration information during
optimization, PRINT controls printing of summary information. If QUICK
is T the summary is based on first order approximations.
\fdocitem{(beta-cdf x alpha beta)}
Returns the value of the Beta(ALPHA, BETA) distribution function at X.
Vectorized.
\fdocitem{(beta-dens x alpha beta)}
Returns the density at X of the Beta(ALPHA, BETA) distribution. Vectorized.
\fdocitem{(beta-quant p alpha beta)}
Returns the P-th quantile of the Beta(ALPHA, BETA) distribution. Vectorized.
\fdocitem{(beta-rand n a b)}
Returns a list of N beta(A, B) random variables. Vectorized.
\fdocitem{(binomial-cdf x n p)}
Returns value of the Binomial(N, P) distribution function at X. Vectorized.
\fdocitem{(binomial-pmf k n p)}
Returns value of the Binomial(N, P) pmf function at integer K. Vectorized.
\fdocitem{(binomial-quant x n p)}
Returns x-th quantile (left continuous inverse) of Binomial(N, P) cdf.
Vectorized.
\fdocitem{(binomial-rand k n p)}
Returns list of K draws from the Binomial(N, P) distribution. Vectorized.
\fdocitem{(bivnorm-cdf x y r)}
Returns the value of the standard bivariate normal distribution function
with correlation R at (X, Y). Vectorized.
\fdocitem{(cauchy-cdf x)}
Returns the value of the standard Cauchy distribution function at X.
Vectorized.
\fdocitem{(cauchy-dens x)}
Returns the density at X of the standard Cauchy distribution. Vectorized.
\fdocitem{(cauchy-quant p)}
Returns the P-th quantile(s) of the standard Cauchy distribution. Vectorized.
\fdocitem{(cauchy-rand n)}
Returns a list of N standard Cauchy random numbers. Vectorized.
\fdocitem{(chisq-cdf x df)}
Returns the value of the Chi-Square(DF) distribution function at X. Vectorized.
\fdocitem{(chisq-dens x alpha)}
Returns the density at X of the Chi-Square(DF) distribution. Vectorized.
\fdocitem{(chisq-quant p df)}
Returns the P-th quantile of the Chi-Square(DF) distribution. Vectorized.
\fdocitem{(chisq-rand n df)}
Returns a list of N Chi-Square(DF) random variables. Vectorized.
\fdocitem{(covariance-matrix \&rest args)}
Returns the sample covariance matrix of the data columns in ARGS. ARGS may
consist of lists, vectors or matrices.
\fdocitem{(difference x)}
Returns differences for a sequence X.
\fdocitem{(f-cdf x ndf ddf)}
Returns the value of the F(NDF, DDF) distribution function at X. Vectorized.
\fdocitem{(f-dens x ndf ddf)}
Returns the density at X of the F(NDF, DDF) distribution. Vectorized.
\fdocitem{(f-quant p ndf ddf)}
Returns the P-th quantile of the F(NDF, DDF) distribution. Vectorized.
\fdocitem{(f-rand n d)}
Returns a list of N F(NDF, DDF) random variables. Vectorized.
\fdocitem{(fivnum number-data)}
Returns the five number summary (min, 1st quartile, medinan, 3rd quartile,
max) of the elements X.
\fdocitem{(gamma-cdf x alpha)}
Returns the value of the Gamma(alpha, 1) distribution function at X.
Vectorized.
\fdocitem{(gamma-dens x alpha)}
Returns the density at X of the Gamma(ALPHA, 1) distribution. Vectorized.
\fdocitem{(gamma-quant p alpha)}
Returns the P-th quantile of the Gamma(ALPHA, 1) distribution. Vectorized.
\fdocitem{(gamma-rand n a)}
Returns a list of N Gamma(A, 1) random variables. Vectorized.
\fdocitem{(interquartile-range number-data)}
Returns the interquartile range of the elements of X.
\fdocitem{(mean x)}
Returns the mean of the elements x. Vector reducing.
\fdocitem{(median x)}
Returns the median of the elements of X.
\fdocitem{(newtonmax f start \&key scale derivstep (verbose 1) return-derivs)}
Maximizes F starting from START using Newton's method with backtracking.
If RETURN-DERIVS is NIL returns location of maximum; otherwise returns
list of location, unction value, gradient and hessian at maximum.
SCALE should be a list of the typical magnitudes of the parameters.
DERIVSTEP is used in numerical derivatives and VERBOSE controls printing
of iteration information. COUNT-LIMIT limits the number of iterations
\fdocitem{(nelmeadmax f start \&key (size 1) (epsilon (sqrt machine-epsilon)) (count-limit 500) (verbose t) alpha beta gamma delta)}
Maximizes F using the Nelder-Mead simplex method. START can be a
starting simplex - a list of N+1 points, with N=dimension of problem,
or a single point. If start is a single point you should give the
size of the initial simplex as SIZE, a sequence of length N. Default is
all 1's. EPSILON is the convergence tolerance. ALPHA-DELTA can be used to
control the behavior of simplex algorithm.
\fdocitem{(normal-cdf x)}
Returns the value of the standard normal distribution function at X.
Vectorized.
\fdocitem{(normal-dens x)}
Returns the density at X of the standard normal distribution. Vectorized.
\fdocitem{(normal-quant p)}
Returns the P-th quantile of the standard normal distribution. Vectorized.
\fdocitem{(normal-rand n)}
Returns a list of N standard normal random numbers. Vectorized.
\fdocitem{(nreg-model mean-function y theta \&key (epsilon 0.0001) (count-limit 20) (print t) parameter-names response-name case-labels weights included (vetbose print))}
Fits nonlinear regression model with MEAN-FUNCTION and response Y
using initial parameter guess THETA. Returns model object.
\fdocitem{(numgrad f x \&optional scale derivstep)}
Computes the numerical gradient of F at X.
\fdocitem{(numhess f x \&optional scale derivstep)}
Computes the numerical Hessian matrix of F at X.
\fdocitem{(oneway-model data \&key (print t))}
DATA: list of compound-data
Example:
\fdocitem{(order x)}
Returns a sequence of the indices of elements in the sequence of numbers
or strings X in order.
\fdocitem{(pmin \&rest items)}
Parallel minimum of ITEMS. Vectorized.
\fdocitem{(pmax \&rest items)}
Parallel maximum of ITEMS. Vectorized.
\fdocitem{(poisson-cdf x mu)}
Returns value of the Poisson(MU) distribution function at X. Vectorized.
\fdocitem{(poisson-pmf k mu)}
Returns value of the Poisson(MU) pmf function at integer K. Vectorized.
\fdocitem{(poisson-quant x mu)}
Returns x-th quantile (left continuous inverse) of Poisson(MU) cdf.
Vectorized.
\fdocitem{(poisson-rand k mu)}
Returns list of K draws from the Poisson(MU) distribution. Vectorized.
\fdocitem{(quantile x p)}
Returns the P-th quantile(s) of sequence X. P can be a number or a sequence.
\fdocitem{(rank x)}
Returns a sequence with the elements of the list or array of numbers or
strings X replaced by their ranks.
\fdocitem{(read-data-columns file cols)}
Reads the data in FILE as COLS columns and returns a list of lists representing
the columns.
\fdocitem{(read-data-file file)}
Returns a list of all lisp objects in FILE. FILE can be a string or a symbol,
in which case the symbol'f print name is used.
\fdocitem{(regression-model x y \&key (intercept t) (print t) weights included predictor-names response-name case-labels)}
X - list of independent variables or X matrix\\
Y - dependent variable\\
INTERCEPT - T to include (default), NIL for no intercept\\
PRINT - if not NIL print summary information\\
WEIGHTS - if supplied should be the same length as Y; error variances are\\
assumed to be inversely proportional to WEIGHTS\\
PREDICTOR-NAMES\\
RESPONSE-NAME\\
CASE-LABELS - sequences of strings or symbols\\
INCLUDED - if supplied should be the same length as Y, with elements nil\\
to skip a in computing estimates (but not in residual analysis)\\
Returns a regression model object. To examine the model further assign the
result to a variable and send it messages.
Example (data are in file absorbtion.lsp in the sample data directory/folder):\\
(def m (regression-model (list iron aluminum) absorbtion))\\
(send m :help)\\
(send m :plot-residuals)
\fdocitem{(sort-data sequence)}
Returns a sequence with the numbers or strings in the sequence X in order.
\fdocitem{(standard-deviation x)}
Returns the standard deviation of the elements x. Vector reducing.
\fdocitem{(t-cdf x df)}
Returns the value of the T(DF) distribution function at X. Vectorized.
\fdocitem{(t-dens x alpha)}
Returns the density at X of the T(DF) distribution. Vectorized.
\fdocitem{(t-quant p df)}
Returns the P-th quantile of the T(DF) distribution. Vectorized.
\fdocitem{(t-rand n d)}
Returns a list of N T(DF) random variables. Vectorized.
\fdocitem{(uniform-rand n)}
Returns a list of N uniform random variables from the range (0, 1).
Vectorized.
\end{lispdoc}
\subsection{Plotting Functions}
\begin{lispdoc}
\fdocitem{(boxplot data \&key (title "Box Plot"))}
DATA is a sequence, a list of sequences or a matrix. Makes a boxplot of the
sequence or a parallel box plot of the sequences in the list or the columns
of the matrix.
\fdocitem{(boxplot-x x data \&key (title "Box Plot"))}
DATA is a list of sequences or a matrix. X is a sequence with as many
elements as DATA has elements or columns. Makes a parallel box plot
of the sequences in the list or the columns of the matrix vs X.
\fdocitem{(close-all-plots)}
Close all plot windos.
\fdocitem{(histogram data \&key (title "Histogram"))}
Opens a window with a histogram of DATA. TITLE is the window title. The number
of bins used can be adjusted using the histogram menu. The histogram can be
linked to other plots with the link-views command. Returns a plot object.
\fdocitem{(link-views \&rest plots)}
Links the argument plots: any change in hiliting or visibility of points in
the current plot is propagated to the other plots.
\fdocitem{(name-list names \&key (title "Name List"))}
NAMES is a number or a list of character strings. Opens a window with a list
of the supplied character strings or entries numbered from 0 to NAMES - 1.
This display can be linked to plots with the link-views function. Returns a
plot object.
\fdocitem{(plot-function f xmin xmax \&optional (num-points 50))}
Plots function F of one real variable over the range between xmin and xmax.
The function is evaluated at NUM-POINTS points.
\fdocitem{(plot-lines x y \&key (title "Line Plot") variable-labels type width color)}
Opens a window with a connected line plot of X vs Y, where X and Y are
compound number-data. VARIABLE-LABELS, if supplied, should be lists of
character strings. TITLE is the window title. The plot can be linked to
other plots with the link-views command. Returns a plot object.
\fdocitem{(plot-points x y \&key (title "Scatter Plot") variable-labels point-labels symbol color)}
Opens a window with a scatter plot of X vs Y, where X and Y are compound
number-data. VARIABLE-LABELS and POINT-LABELS, if supplied, should be lists of
character strings. TITLE is the window title. The plot can be linked to
other plots with the link-views command. Returns a plot object.
\fdocitem{(probability-plot data \&key (distribution-function (function normal-cdf)) (title "Probability Plot") point-labels)}
\fdocitem{(quantile-plot data \&key (quantile-function (function normal-quant)) (title "Quantile Plot") point-labels)}
\fdocitem{(scatterplot-matrix data \&key (title "Spinning Plot") variable-labels point-labels (scale t))}
DATA is a list of two or more compound number-data objects of equal length.
Opens a window with a brushable scatter plot matrix of the elements of DATA.
VARIABLE-LABELS and POINT-LABELS, if supplied, should be lists of character strings.
TITLE is the window title. If scale is NIL data are assumed to be between -1
and 1.The plot can be linked to other plots with the link-views command.
Returns a plot object.
\fdocitem{(spin-function f xmin xmax ymin ymax \&optional (num-points 6))}
Rotatable plot of function F of two real variables over the range
between [xmin, xmax] x [ymin, ymax]. The function is evaluated at
NUM-POINTS points.
\fdocitem{(spin-plot data \&key (title "Spinning Plot") variable-labels point-labels (scale t))}
DATA is a list of three compound number-data objects of equal length. Opens
a window with a rotating plot of the three elements of DATA. VARIABLE-LABELS
and POINT-LABELS, if supplied, should be lists of character strings. TITLE
is the window title. If scale is NIL data are assumed to be between -1 and 1.
The plot can be linked to other plots with the link-views command. Returns
a plot object.
\fdocitem{(unlink-views \&rest plots)}
Removes links to its arguments. With no arguments removes all links.
\end{lispdoc}
\subsection{Object Methods}
\subsubsection{Regression Methods}
\begin{lispdoc}
\odocitem{:basis }
Returns the indices of the variables used in fitting the model.
\odocitem{:coef-estimates }
Returns the OLS (ordinary least squares) estimates of the regression
coefficients. Entries beyond the intercept correspond to entries in basis.
\odocitem{:coef-standard-errors }
Returns estimated standard errors of coefficients. Entries beyond the
intercept correspond to entries in basis.
\odocitem{:cooks-distances }
Computes Cook's distances.
\odocitem{:df }
Returns the number of degrees of freedom in the model.
\odocitem{:display }
Prints the least squares regression summary. Variables not used in the fit
are marked as aliased.
\odocitem{:fit-values }
Returns the fitted values for the model.
\odocitem{:included \&optional new-included }
With no argument, NIL means a case is not used in calculating estimates, and non-nil means it is used. NEW-INCLUDED is a sequence of length of y of nil and t to select cases. Estimates are recomputed.
\odocitem{:intercept \&optional new-intercept }
With no argument returns T if the model includes an intercept term, nil if
not. With an argument NEW-INTERCEPT the model is changed to include or
exclude an intercept, according to the value of NEW-INTERCEPT.
\odocitem{:leverages }
Returns the diagonal elements of the hat matrix.
\odocitem{:num-cases }
Returns the number of cases in the model.
\odocitem{:num-coefs }
Returns the number of coefficients in the fit model (including the
intercept if the model includes one).
\odocitem{:num-included }
Returns the number of cases used in the computations.
\odocitem{:plot-bayes-residuals \&optional x-values }
Opens a window with a plot of the standardized residuals and two standard
error bars for the posterior distribution of the actual deviations from the
line. See Chaloner and Brant. If X-VALUES are not supplied the fitted values
are used. The plot can be linked to other plots with the link-views function.
Returns a plot object.
\odocitem{:plot-residuals \&optional x-values }
Opens a window with a plot of the residuals. If X-VALUES are not supplied
the fitted values are used. The plot can be linked to other plots with the
link-views function. Returns a plot object.
\odocitem{:predictor-names \&optional (names nil set) }
With no argument returns the predictor names. NAMES sets the names.
\odocitem{:r-squared }
Returns the sample squared multiple correlation coefficient, R squared, for
the regression.
\odocitem{:raw-residuals }
Returns the raw residuals for a model.
\odocitem{:residuals }
Returns the raw residuals for a model without weights. If the model
includes weights the raw residuals times the square roots of the weights
are returned.
\odocitem{:sigma-hat }
Returns the estimated standard deviation of the deviations about the
regression line.
\odocitem{:studentized-residuals }
Computes the internally studentized residuals for included cases and externally studentized residuals for excluded cases.
\odocitem{:sum-of-squares }
Returns the error sum of squares for the model.
\odocitem{:weights \&optional new-w }
With no argument returns the weight sequence as supplied to m; NIL means
an unweighted model. NEW-W sets the weights sequence to NEW-W and
recomputes the estimates.
\odocitem{:x-matrix }
Returns the X matrix for the model, including a column of 1's, if
appropriate. Columns of X matrix correspond to entries in basis.
\odocitem{:xtxinv }
Returns $(X^{T} X)^{-1}$ or $(X^{T} W X)^{-1}$.
\end{lispdoc}
\subsubsection{General Plot Methods}
\begin{lispdoc}
\odocitem{:add-lines lines \&key type (draw t) }
Adds lines to plot. LINES is a list of sequences, the coordinates of the line starts.
TYPE is normal or dashed. If DRAW is true the new lines are added to the screen.
\odocitem{:add-points points \&key point-labels (draw t) }
Adds points to plot. POINTS is a list of sequences, POINT-LABELS a list of
strings. If DRAW is true the new points are added to the screen.
\odocitem{:adjust-to-data \&key (draw t) }
Sets ranges to the actual range of variables in the original coordinate
system. If DRAW is true sends :RESIZE and :REDRAW messages.
\odocitem{:all-points-showing-p }
\odocitem{:all-points-unmasked-p }
\odocitem{:any-points-selected-p }
\odocitem{:apply-transformation a \&key draw }
Applies matrix A to current transformation. If draw is true the :REDRAW-CONTENT
message is sent.
\odocitem{:clear \&key (draw t) }
Clears the plot data. If DRAW is nil the plot is redrawn; otherwise its
current screen image remains unchanged.
\odocitem{:clear-lines \&key (draw t) }
Removes all lines from the plot. If DRAW is true the :REDRAW-CONTENT
message is sent.
\odocitem{:clear-points \&key (draw t) }
Removes all points from the plot. If DRAW is true the :REDRAW-CONTENT
message is sent.
\odocitem{:clear-strings \&key (draw t) }
Removes all strings from the plot. If DRAW is true the :REDRAW-CONTENT
message is sent.
\odocitem{:content-variables \&optional xvar yvar }
Sets or retrieves the indices of the current content variables.
%*****(GRAPH-PROTO OBJECT :DO-BUTTON-DOWN)
%*****(GRAPH-PROTO OBJECT :DO-IDLE)
\odocitem{:do-mouse x y type extend option }
Sends appropriate action message for mouse mode to plot.
\odocitem{:drag-grey-rect x y width height }
Drags grey rectangle starting at (LIST (- X WIDTH) (- Y HEIGHT) WIDTH HEIGHT)
while mouse button is down. Returns the final rectangle. Should be called when
the mouse is down.
%*****(GRAPH-PROTO OBJECT :DRAG-POINT)
\odocitem{:erase-selection }
Sets selected points states to invisible and sends :ADJUST-SCREEN message.
\odocitem{:fixed-aspect \&optional fixed }
Sets or retrieves current size adjustment option (true or NIL).
\odocitem{:frame-location \&optional left top }
Moves window frame to (LEFT TOP) if supplied. Returns list of
current left, top. Adjusts for the menu bar.
\odocitem{:frame-size \&optional width height }
Sets window frame width and size to WIDTH and SIZE if supplied.
Returns list of current WIDTH and HEIGHT. Adjusts for the menu bar.
\odocitem{:idle-on \&optional on }
Sets or returns idling state. On means :do-idle method is sent each pass through
the event loop.
\odocitem{:linked \&optional on }
Sets or retrieves plot's linking state.
\odocitem{:num-lines }
Returns the number of line starts in the plot.
\odocitem{:num-points }
Returns the number of points in the plot.
\odocitem{:num-strings }
Returns the number of strings in the plot.
\odocitem{:num-variables }
Returns the number of variables in the plot.
\odocitem{:point-coordinate var point \&optional value }
Sets or retrieves coordinate for variable VAR and point POINT in the original
coordinate system. Vectorized.
\odocitem{:point-hilited point \&optional hilited }
Sets or returns highlighting status (true or NIL) of POINT. Sends
:ADJUST-SCREEN message if states are set. Vectorized.
\odocitem{:point-label point \&optional label }
Sets or retrieves label of point POINT. Vectorized.
\odocitem{:point-selected point \&optional selected }
Sets or returns selection status (true or NIL) of POINT. Sends
:ADJUST-SCREEN message if states are set. Vectorized.
\odocitem{:point-showing point \&optional selected }
Sets or returns visibility status (true or NIL) of POINT. Sends
:ADJUST-SCREEN message if states are set. Vectorized.
\odocitem{:point-symbol point \&optional symbol }
Sets or retrieves symbol of point POINT. Vectorized.
\odocitem{:range index \&optional low high }
Sets or retrieves variable's original coordinate range. Vectorized.
\odocitem{:real-to-screen x y }
Returns list of screen coordinates of point (X, Y), in the original coordinate system,
based on current content variables.
\odocitem{:redraw }
Redraws entire plot.
\odocitem{:redraw-content }
Redraws plot's content.
\odocitem{:rotate-2 var1 var2 angle \&key (draw t) }
Rotates int the plane of variables with indices VAR1 and VAR2 by ANGLE, in
radians. sends the :REDRAW-CONTENT message if DRWA is true.
\odocitem{:scale-to-range var low high \&key (draw t) }
Scales and shifts data to map visible range into specified range. Sends
:RESIZE and :REDRAW messages if DRAW is true.
\odocitem{:scaled-range index \&optional low high }
Sets or retrieves variable's transformed coordinate range. Vectorized.
\odocitem{:screen-to-real x y }
Returns list of real coordinates, in the original coordinate system, of
screen point (X, Y), based on current content variables.
\odocitem{:selection }
Return indices of current selection.
\odocitem{:show-all-points }
Sets all point states to normal and sends :ADJUST-SCREEN message
\odocitem{:showing-labels \&optional showing }
Sets or retrieves current labeling state (true or NIL).
\odocitem{:title \&optional string }
Sets or retrieves window title.
\odocitem{:transformation \&optional a \&key (draw t) }
Sets or retrieves transformation. A should be a matrix or NIL. If draw is true
the :REDRAW-CONTENT message is sent.
\odocitem{:unselect-all-points \&key (draw t) }
Unselects all points. Sends :ADJUST-SCREEN message if DRAW is true.
%*****(GRAPH-PROTO OBJECT :UNSHOW-ALL-POINTS)
\odocitem{:variable-label var \&optional label }
Sets or returns label for variable with index VAR. Vectorized.
\odocitem{:visible-range var }
Returns list of min and max of variable VAR over visible, unmasked points,
lines and strings. Vectorized.
\odocitem{:while-button-down fcn \&optional (motion-only t) }
Calls fcn repeatedly while mouse button is down. FCN should take two arguments,
the current x and y coordinates of the mouse. Returns NIL. Should be called
when button is already down.
\odocitem{:x-axis \&optional showing labeled ticks }
Sets or retrieves current acis label state. SHOWING and LABELED should be
true or NIL; TICKS should be a number. All three should be supplied for setting
a new state. A list of the three properties is returned.
\odocitem{:y-axis \&optional showing labeled ticks }
Sets or retrieves current acis label state. SHOWING and LABELED should be
true or NIL; TICKS should be a number. All three should be supplied for setting
a new state. A list of the three properties is returned.
\end{lispdoc}
\subsubsection{Histogram Methods}
\begin{lispdoc}
\odocitem{:add-points points (draw t) }
Adds points to plot. POINTS is a sequence or a list of sequences. If DRAW is
true the new points are added to the screen.
\odocitem{:num-bins \&optional bins \&key (draw t) }
Sets or retrieves number of bins in the histogram. Sends :REDRAW-CONTENT message
if DRAW is true.
\end{lispdoc}
\subsubsection{Name List Methods}
\begin{lispdoc}
\odocitem{:add-points points \&key point-labels (draw t) }
Adds points to plot. POINTS is a number or a list of sequences, POINT-LABELS a list of
strings. If DRAW is true the new points are added to the screen.
\end{lispdoc}
\subsubsection{Scatterplot Methods}
\begin{lispdoc}
\odocitem{:abline a b }
Adds the graph of the line A + B x to the plot.
%*****(SCATTERPLOT-PROTO OBJECT :ADD-FUNCTION)
\odocitem{:add-lines lines \&key type (draw t) }
Adds lines to plot. LINES is a list of sequences, the coordinates of the line starts.
TYPE is normal or dashed. If DRAW is true the new lines are added to the screen.
\odocitem{:add-points points \&key point-labels (draw t) }
Adds points to plot. POINTS is a list of sequences, POINT-LABELS a list of
strings. If DRAW is true the new points are added to the screen.
\odocitem{:add-strings locations strings }
Adds strings to plot. LOCATIONS is a list of sequences, the coordinates of the
strings. If DRAW is true the new lines are added to the screen.
\end{lispdoc}
\subsubsection{Spin Plot Methods}
\begin{lispdoc}
\odocitem{:abcplane a b c }
Adds the graph of the plane A + B x + Cy to the plot.
\odocitem{:add-function } surface of function F over a NUM-POINTS by NUM-POINTS grid on the
rectangle [xmin, xmax] x [ymin, ymax]. Passes other keywords to
:add-surface method.
\odocitem{:add-surface } a grid surface using sequences X, Y with values in the matrix Z.
Z should be (length X) by (length Y).
\odocitem{:angle \&optional angle }
Sets or retrieves current rotation angle, in radians.
\odocitem{:content-variables \&optional xvar yvar }
Sets or retrieves the indices of the current content variables.
\odocitem{:depth-cuing \&optional cuing }
Sets or retrieves depth cuing status (true or NIL).
\odocitem{:do-idle }
Sends :ROTATE message.
\odocitem{:rotate }
Rotates once in the current plane by the current angle.
\odocitem{:showing-axes \&optional cuing }
Sets or retrieves axis showing status (true or NIL).
\end{lispdoc}
\subsection{Some Useful Array and Linear Algebra Functions}
\label{Appendix.Arrays}
\begin{lispdoc}
\fdocitem{(\%* a b)}
Returns the matrix product of matrices a and b. If a is a vector it is
treated as a row vector; if b is a vector it is treated as a column
vector.
\fdocitem{(aref array \&rest subscripts)}
Returns the element of ARRAY specified by SUBSCRIPTS.
\fdocitem{(array-dimension array)}
Returns a list whose elements are the dimensions of ARRAY
\fdocitem{(array-dimensions array)}
Returns a list whose elements are the dimensions of ARRAY
\fdocitem{(array-in-bounds-p array \&rest subscripts)}
Returns T if SUBSCRIPTS are valid subscripts for ARRAY; NIL otherwise.
\fdocitem{(array-rank array)}
Returns the number of dimensions of ARRAY.
\fdocitem{(array-row-major-index array \&rest subscripts)}
Returns the index into the data vector of ARRAY for the element of ARRAY
specified by SUBSCRIPTS.
\fdocitem{(array-total-size array)}
Returns the total number of elements of ARRAY.
\fdocitem{(arrayp x)}
Returns T if X is an array; NIL otherwise.
\fdocitem{(bind-columns \&rest args)}
The ARGS can be matrices, vectors, or lists. Arguments are bound into a matrix
along their columns.
Example: (bind-columns \#2a((1 2)(3 4)) \#(5 6)) returns \#2a((1 2 5)(3 4 6))
\fdocitem{(bind-rows \&rest args)}
The ARGS can be matrices, vectors, or lists. Arguments are bound into a matrix
along their rows.
Example: (bind-rows \#2a((1 2)(3 4)) \#(5 6)) returns \#2a((1 2)(3 4)(5 6))
\fdocitem{(chol-decomp a)}
Modified Cholesky decomposition. $A$ should be a square, symmetric
matrix. Computes lower triangular matrix $L$ such that $L L^T = A + D$
where $D$ is a diagonal matrix. If $A$ is strictly positive definite $D$
will be zero. Otherwise $D$ is as small as possible to make $A + D$
numerically strictly positive definite. Returns a list $(L (max D))$.
\fdocitem{(column-list m)}
Returns a list of the columns of M as vectors
\fdocitem{(copy-array array)}
Returns a copy of ARRAY with elements eq to the elements of ARRAY.
\fdocitem{(copy-list list)}
Returns a new copy of LIST.
\fdocitem{(copy-vector vector)}
Returns a copy of VECTOR with elements eq to the elements of VECTOR
\fdocitem{(count-elements number \&rest more-numbers)}
Returns the number of its arguments. Vector reducing
\fdocitem{(cross-product x)}
If X is a matrix returns (matmult (transpose X) X). If X is a vector
returns (inner-product X X).
\fdocitem{(determinant m)}
Returns the determinant of the square matrix M.
\fdocitem{(diagonal x)}
If X is a matrix, returns the diagonal of X. If X is a sequence, returns a
diagonal matrix of rank (length X) with diagonal elements eq to the elements
of X.
\fdocitem{(identity-matrix n)}
Returns the identity matrix of rank N.
\fdocitem{(inner-product x y)}
Returns inner product of sequences X and Y.
\fdocitem{(inverse m)}
Returns the inverse of the the square matrix M; signals an error if M is ill
conditioned or singular
\fdocitem{(lu-decomp a)}
A is a square matrix of numbers (real or complex). Computes the LU
decomposition of A and returns a list of the form (LU IV D FLAG), where
LU is a matrix with the L part in the lower triangle, the U part in the
upper triangle (the diagonal entries of L are taken to be 1), IV is a vector
describing the row permutation used, D is 1 if the number of permutations
is odd, -1 if even, and FLAG is T if A is numerically singular, NIL otherwise.
Used bu LU-SOLVE.
\fdocitem{(lu-solve lu b)}
LU is the result of (LU-DECOMP A) for a square matrix A, B is a sequence.
Returns the solution to the equation Ax = B. Signals an error if A is singular.
\fdocitem{(make-list size \&key (initial-element nil))}
Creates and returns a list containing SIZE elements, each of which is
initialized to INITIAL-ELEMENT.
\fdocitem{(make-sweep-matrix x y \&optional weights)}
X is a matrix, Y and WEIGHTS are sequences. Returns the sweep matrix for the
(possibly weighted) regression of Y on X.
\fdocitem{(map-elements function data \&rest more-data)}
FUNCTION must take as many arguments as there are DATA arguments supplied.
DATA arguments must either all be sequences or all be arrays of the same
shape. The result is of the same type and shape as the first DATA argument,
with elements the result of applying FUNCTION elementwise to the DATA
arguments
\fdocitem{(matmult a b)}
Returns the matrix product of matrices a and b. If a is a vector it is
treated as a row vector; if b is a vector it is treated as a column
vector.
\fdocitem{(matrix dim data)}
returns a matrix of dimensions DIM initialized using sequence DATA
in row major order.
\fdocitem{(matrixp m)}
Returns T if M is a matrix, NIL otherwise.
\fdocitem{(outer-product x y \&optional (fcn \#'*))}
Returns the generalized outer product of x and y, using fcn. That is,
the result is a matrix of dimension ((length x) (length y)) and the (i
j) element of the result is computed as (apply fcn (aref x i) (aref y
j)).
\fdocitem{(permute-array a p)}
Returns a copy of the array A permuted according to the permutation P.
\fdocitem{(qr-decomp a)}
A is a matrix of real numbers with at least as many rows as columns. Computes
the QR factorization of A and returns the result in a list of the form (Q R).
\fdocitem{(rcondest a)}
Returns an estimate of the reciprocal of the L1 condition number of an upper
triangular matrix a.
\fdocitem{(row-list m)}
Returns a list of the rows of M as vectors
\fdocitem{(solve a b)}
Solves A x = B using LU decomposition and backsolving. B can be a sequence
or a matrix.
\fdocitem{(split-list list cols)}
Returns a list of COLS lists of equal length of the elements of LIST.
Example: (split-list '(1 2 3 4 5 6) 2) returns ((1 2 3) (4 5 6))
\fdocitem{(sum \&rest number-data)}
Returns the sum of all the elements of its arguments. Returns 0 if there
are no arguments. Vector reducing.
\fdocitem{(sv-decomp a)}
A is a matrix of real numbers with at least as many rows as columns.
Computes the singular value decomposition of A and returns a list of the form
(U W V FLAG) where U and V are matrices whose columns are the left and right
singular vectors of A and W is the sequence of singular values of A. FLAG is T
if the algorithm converged, NIL otherwise.
\fdocitem{(sweep-operator a indices \&optional tolerances)}
A is a matrix, INDICES a sequence of the column indices to be swept. Returns
a list of the swept result and the list of the columns actually swept. (See
MULTREG documentation.) If supplied, TOLERANCES should be a list of real
numbers the same length as INDICES. An index will only be swept if its pivot
element is larger than the corresponding element of TOLERANCES.
\fdocitem{(transpose m)}
Returns the transpose of the matrix M.
\fdocitem{(vectorp m)}
Returns T if M is a vector, NIL otherwise.
\end{lispdoc}
\subsection{System Functions}
\begin{lispdoc}
\fdocitem{(alloc number)}
Changes number of nodes to allocate in each segment to NUMBER. Returns
old number of nodes to allocate.
\fdocitem{(call-cfun cfun \&rest args)}
CFUN is a string naming a C function. The remaining arguments must be
integers, sequences of integers, reals or sequences of reals. CFUN is
called with the remaining arguments and a list of the lists of the
values of the arguments after the call is returned. Arguments in the
call will be pointers to ints or pointers to doubles. Not available
on all implementations.
\fdocitem{(call-fsub fsub \&rest args)}
FSUB is a string naming a FORTRAN subroutine. The remaining arguments
must be integers, sequences of integers, reals or sequences of reals.
FSUB is called with the remaining arguments and a list of the lists of
the values of the arguments after the call is returned. Arguments in
the call will be (arrays of) integers or double precision numbers. Not
available on all implementations.
\fdocitem{(call-lfun lfun \&rest args)}
LFUN is a C function written to conform to internal XLISP argument
reading and value returning conventions. Applies LFUN to ARGS and
returns the result.
\fdocitem{(debug)}
Enable breaking on error on.
\fdocitem{(dyn-load file \&key verbose libflags fortran)}
Links the object file FILE with standard C libraries and loads into
the running XLISP-STAT process. If FORTRAN is not NIL also searches
standard FORTRAN libraries. LIBFLAGS can be a string used to specify
additional libraries, for example
\fdocitem{(exit)}
Exits from XLISP.
\fdocitem{(expand number)}
Expand memory by adding NUMBER segments. Returns the number of segments.
\fdocitem{(gc)}
Forces garbage collection. Returns nil.
\fdocitem{(help \&optional symbol)}
Prints the documentation associated with SYMBOL. With no argument,
this function prints the greeting message to beginners.
\fdocitem{(help* string)}
Prints the documentation associated with those symbols whose print names
contain STRING as substring. STRING may be a symbol, in which case the
print-name of that symbol is used.
\fdocitem{(load filename \&key (verbose t) (print nil))}
Loads the file named by FILENAME into XLISP. Returns T if load succeeds,
NIL if file does not exist.
\fdocitem{(nodebug)}
Disable breaking on error on.
\fdocitem{(room)}
Shows memory allocation statistics. Returns nil.
\fdocitem{(save file)}
Saves current memory image in FILE.wks. Does not work right with allocated objects.
\fdocitem{(variables)}
Prints the names of all def'ed variables
\end{lispdoc}
\subsection{Some Basic Lisp Functions, Macros and Special Forms}
Except where noted these functions should have a significant subset of their
Common Lisp functionality as defined in Steele \cite{CLtL}.
\begin{lispdoc}
\mdocitem{(and \{form\}*)}
Evaluates FORMs in order from left to right. If any FORM evaluates to NIL,
returns immediately with the value NIL. Else, returns the value of the
last FORM.
\fdocitem{(append \&rest lists)}
Constructs a new list by concatenating its arguments.
\fdocitem{(apply function \&rest args)}
Conses all arguments but the last onto the last and applies FUNCTION to
the resulting argument list. Last argument must be a list.
\fdocitem{(apropos string)}
Prints symbols whose print-names contain STRING as substring.
If STRING is a symbol its print name is used.
\fdocitem{(apropos-list string)}
Returns, as a list, all symbols whose print-names contain STRING as substring.
If STRING is a symbol its print name is used.
\fdocitem{(assoc item alist \&key (test (function eql)) test-not)}
Returns the first pair in ALIST whose car is equal (in the sense of TEST) to
ITEM.
\fdocitem{(atom x)}
Returns T if X is not a cons; NIL otherwise.
\fdocitem{(boundp symbol)}
Returns T if the global variable named by SYMBOL has a value; NIL otherwise.
%*****C[AD]R
\fdocitem{(car list)}
Returns the car of LIST. Returns NIL if LIST is NIL.
\fdocitem{(case keyform { ({key $|$ ({key}*) } {form}*) }*)}
Evaluates KEYFORM and tries to find the KEY that is EQL to the value of
KEYFORM. If one is found, then evaluates FORMs that follow the KEY and
returns the value of the last FORM. If not, simply returns NIL.
\fdocitem{(cdr list)}
Returns the cdr of LIST. Returns NIL if LIST is NIL.
\fdocitem{(close stream)}
Close file stream STREAM.
\fdocitem{(coerce x type)}
Coerces X to an object of the type TYPE.
\fdocitem{(cond { (test {form}*) }*)}
Evaluates each TEST in order until one evaluates to a non-NIL value. Then
evaluates the associated FORMs in order and returns the value of the last
FORM. If no forms follow the TEST, then returns the value of the TEST.
Returns NIL, if all TESTs evaluate to NIL.
\fdocitem{(cons x y)}
Returns a new cons (list node) whose car and cdr are X and Y, respectively.
\fdocitem{(consp x)}
Returns T if X is a cons; NIL otherwise.
\mdocitem{(defmacro name defmacro-lambda-list [doc] \{form\}*)}
Defines a macro as the global definition of the symbol NAME. The complete
syntax of a lambda-list is:
({var}*
[\&optional {var}*]
[\&rest var]
[\&aux {var}*])
The doc-string DOC, if supplied, is saved as a FUNCTION doc and can be
retrieved by (documentation 'NAME 'function).
\mdocitem{(defun name lambda-list [doc] \{form\}*)}
Defines a function as the global definition of the symbol NAME. The
complete syntax of a lambda-list is:
({var}*
[\&optional {var}*]
[\&rest var]
[\&aux {var}*])
The doc-string DOC, if supplied, is saved as a FUNCTION doc and can be
retrieved by (documentation 'NAME 'function).
\mdocitem{(do (\{(var [init [step]])\}*) (endtest \{result\}*) \{tag $|$ statement\}*)}
Creates a NIL block, binds each VAR to the value of the corresponding INIT,
and then executes STATEMENTs repeatedly until ENDTEST is satisfied. After
each iteration, assigns to each VAR the value of the corresponding STEP. When
ENDTEST is satisfied, evaluates RESULTs as a PROGN and returns the value of
the last RESULT (or NIL if no RESULTs are supplied). Performs variable
bindings and assignments all at once, just like LET does.
\mdocitem{(do* (\{(var [init [step]])\}*) (endtest \{result\}*) {tag $|$ statement}*)}
Just like DO, but performs variable bindings and assignments in serial, just
like LET* and SETQ do.
\mdocitem{(dolist (var listform [result]) \{tag $|$ statement\}*)}
Executes STATEMENTs, with VAR bound to each member of the list value of
LISTFORM. Then returns the value of RESULT (which defaults to NIL).
\mdocitem{(dotimes (var countform [result]) \{tag $|$ statement\}*)}
Executes STATEMENTs, with VAR bound to each number between 0 (inclusive) and
the value of COUNTFORM (exclusive). Then returns the value of RESULT
(which defaults to NIL).
\fdocitem{(elt a \&rest indices)}
A can be a list or an array. If A is a list and INDICES is a single number
then the appropriate element of A is returned. If is a list and INDICES is
a list of numbers then the sublist of the corresponding elements is returned.
If A in an array then the number of INDICES must match the ARRAY-RANK of A.
If each index is a number then the appropriate array element is returned.
Otherwise the INDICES must all be lists of numbers and the corresponding
submatrix of A is returned. ELT can be used in setf.
\fdocitem{(eq x y)}
Returns T if X and Y are the same identical object; NIL otherwise.
\fdocitem{(eql x y)}
Returns T if X and Y are EQ, or if they are numbers of the same type with
the same value, or if they are identical strings. Returns NIL otherwise.
\fdocitem{(equal x y)}
Returns T if X and Y are EQL or if they are of the same type and corresponding
components are EQUAL. Returns NIL otherwise. Arrays must be EQ to be EQUAL.
\fdocitem{(equalp x y)}
Returns T if (equal x y), or x, y are numbers and (= x y), or
x and y are strings and (string-equal x y).
\fdocitem{(first x)}
Equivalent to (CAR X).
\fdocitem{(format destination control \&rest args)}
Very basic implementation of Common Lisp format function. Only A, S, D, F, E,
G, %, and ~ directives are supported. D, % and ~ can take one argument, R, E
and G can take two.
\fdocitem{(funcall function \&rest arguments)}
Applies FUNCTION to the ARGUMENTs
\docitem{(function x)}{Special Form} or \#'x
If X is a lambda expression, creates and returns a lexical closure of X in
the current lexical environment. If X is a symbol that names a function,
returns that function.
\fdocitem{(getf place indicator \&optional default)}
Returns property value of INDICATOR in PLACE, or DEFAULT if not found.
\fdocitem{(identity x)}
Simply returns X.
\mdocitem{(if test then [else])}
If TEST evaluates to non-NIL, then evaluates THEN and returns the result.
If not, evaluates ELSE (which defaults to NIL) and returns the result.
\fdocitem{(last list)}
Returns the last cons in LIST
\fdocitem{(length sequence)}
Returns the length of SEQUENCE.
\fdocitem{(let ({var $|$ (var [value]) }*) {form}*)}
Initializes VARs, binding them to the values of VALUEs (which defaults to NIL)
all at once, then evaluates FORMs as a PROGN.
\fdocitem{(let* ({var $|$ (var [value]) }*) {form}*)}
Initializes VARs, binding them to the values of VALUEs (which defaults to NIL)
from left to right, then evaluates FORMs as a PROGN.
\fdocitem{(listp x)}
Returns T if X is either a cons or NIL; NIL otherwise.
\fdocitem{(map result-type function sequence \&rest more-sequences)}
FUNCTION must take as many arguments as there are sequences provided. RESULT-TYPE
must be the either the symbol VECTOR or the symbol LIST. The result is a
sequence of the specified type such that the i-th element of the result is the
result of applying FUNCTION to the i-th elements of the SEQUENCEs.
\fdocitem{(mapc fun list \&rest more-lists)}
Applies FUN to successive cars of LISTs. Returns the first LIST.
%*****MAPCAN
\fdocitem{(mapcar fun list \&rest more-lists)}
Applies FUN to successive cars of LISTs and returns the results as a list.
%*****MAPCON
\fdocitem{(mapl fun list \&rest more-lists)}
Applies FUN to successive cdrs of LISTs. Returns the first LIST.
\fdocitem{(maplist fun list \&rest more-lists)}
Applies FUN to successive cdrs of LISTs and returns the results as a list.
\fdocitem{(member item list \&key (test (function eql)) test-not)}
Returns the tail of LIST beginning with the first ITEM.
\fdocitem{(not x)}
Returns T if X is NIL; NIL otherwise.
\fdocitem{(nth n list)}
Returns the N-th element of LIST, where the car of LIST is the zero-th
element.
\fdocitem{(nthcdr n list)}
Returns the result of performing the CDR operation N times on LIST.
\fdocitem{(null x)}
Returns T if X is NIL; NIL otherwise.
\fdocitem{(numberp x)}
Returns T if X is any kind of number; NIL otherwise.
\fdocitem{(objectp x)}
Returns T if X is an object, NIL otherwise.
\fdocitem{(open fname \&key (direction :input))}
Opens file named by string or symbol FNAME. DIRECTION is :INPUT or :OUTPUT.
\mdocitem{(or \{form\}*)}
Evaluates FORMs in order from left to right. If any FORM evaluates to
non-NIL, quits and returns that value. If the last FORM is reached,
returns whatever value it returns.
\fdocitem{(prin1 object \&optional (stream *standard-output*))}
Prints OBJECT in the most readable representation. Returns OBJECT.
\fdocitem{(princ object \&optional (stream *standard-output*))}
Prints OBJECT without escape characters. Returns OBJECT.
\fdocitem{(print object \&optional (stream *standard-output*))}
Outputs a newline character, and then prints OBJECT in the most readable
representation. Returns OBJECT.
\mdocitem{(prog (\{var $|$ (var [init])\}*) \{tag $|$ statement\}*)}
Binds VARs in parallel, and then executes STATEMENTs.
\mdocitem{(prog* (\{var $|$ (var [init])\}*) \{tag $|$ statement\}*)}
Binds VARs sequentially, and then executes STATEMENTs.
\mdocitem{(prog1 first \{form\}*)}
Evaluates FIRST and FORMs in order, and returns the value of FIRST.
\mdocitem{(prog2 first second \{forms\}*)}
Evaluates FIRST, SECOND, and FORMs in order, and returns the value
of SECOND.
\mdocitem{(progn \{form\}*)}
Evaluates FORMs in order, and returns whatever the last FORM returns.
\mdocitem{(progv symbols values \{form\}*)}
Evaluates FORMs in order, with SYMBOLS dynamically bound to VALUES,
and returns whatever the last FORM returns.
\fdocitem{(provide name)}
Adds NAME to the list of modules.
\docitem{(quote x)}{Special Form} or 'x
Returns X without evaluating it.
\fdocitem{(read \&optional (stream *standard-input*) (eof-error-p t) (eof-value nil) (recursivep nil))}
Reads and returns the next object from STREAM.
\fdocitem{(reduce function sequence \&key initial-value)}
Combines all the elements of SEQUENCE using a binary operation FUNCTION. If
INITIAL-VALUE is supplied it is logically placed before SEQUENCE.
\fdocitem{(remove item list \&key (test (function eql)) test-not)}
Returns a copy of LIST with ITEM removed.
\fdocitem{(remove-if test list)}
Returns a copy of LIST with elements satisfying TEST removed.
\fdocitem{(remove-if-not test list)}
Returns a copy of LIST with elements not satisfying TEST removed.
\fdocitem{(require name)}
Loads module NAME, unless it has already been loaded. If PATH is supplied it
is used as the file name; otherwise NAME is used. If file NAME is not in the
current directory *default-path* is searched.
\fdocitem{(rest x)}
Equivalent to (CDR X).
\mdocitem{(return [result])}
Returns from the lexically surrounding PROG construct. The value of RESULT,
which defaults to NIL, is returned as the value of the PROG construct.
\fdocitem{(reverse list)}
Returns a new list containing the same elements as LIST but in
reverse order.
\fdocitem{(second x)}
Equivalent to (CAR (CDR X)).
\fdocitem{(set symbol value)}
Assigns the value of VALUE to the dynamic variable named by SYMBOL (i. e.
it changes the global definition of SYMBOL), and returns the value assigned.
\mdocitem{(setf \{place newvalue\}*)}
Replaces the value in PLACE with the value of NEWVALUE, from left to right.
Returns the value of the last NEWVALUE. Each PLACE may be any one of the
following:
* A symbol that names a variable.
* A function call form whose first element is the name of the following
functions:
nth
aref subarray sublist select elt
get
symbol-value
symbol-plist
documentation
slot-value
c?r c??r c???r c????r
where '?' stands for either 'a' or 'd'.
\mdocitem{(setq \{var form\}*)}
VARs are not evaluated and must be symbols. Assigns the value of the first
FORM to the first VAR, then assigns the value of the second FORM to the second
VAR, and so on. Returns the last value assigned.
\fdocitem{(string sym)}
Returns print-name of SYM if SYM is a symbol, or SYM if SYM is a.
\fdocitem{(stringp x)}
Returns T if X is a string; NIL otherwise.
\fdocitem{(sublis alist tree \&key (test (function eql)) test-not)}
Substitutes from ALIST for subtrees of TREE nondestructively.
\fdocitem{(subst new old tree \&key (test (function eql)) test-not)}
Substitutes NEW for subtrees of TREE that match OLD.
\fdocitem{(symbol-name symbol)}
Returns the print name of the symbol SYMBOL.
\fdocitem{(symbol-plist symbol)}
Returns the property list of SYMBOL.
\fdocitem{(symbol-value symbol)}
Returns the current global value of the variable named by SYMBOL.
\fdocitem{(symbolp x)}
Returns T if X is a symbol; NIL otherwise.
\fdocitem{(terpri \&optional (stream *standard-output*))}
Outputs a newline character.
\mdocitem{(time form)}
Form is evaluated and its result returned. In addition the time required
for the evaluation is printed.
\fdocitem{(type-of x)}
Returns the type of X.
\mdocitem{(unless test \{form\}*)}
If TEST evaluates to NIL evaluates FORMs as a PROGN. If not, returns NIL.
\mdocitem{(unwind-protect protected-form \{cleanup-form\}*)}
Evaluates PROTECTED-FORM and returns whatever it returned. Guarantees that
CLEANUP-FORMs be always evaluated before exiting from the UNWIND-PROTECT
form.
\mdocitem{(when test \{form\}*)}
If TEST evaluates to non-NIL evaluates FORMs as a PROGN. If not, returns NIL.
\end{lispdoc}