Except where noted these functions should have a significant subset of their
Common Lisp functionality as defined in Steele [12].
- (and {form}*) [Macro]
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.
- (append &rest lists) [Function]
Constructs a new list by concatenating its arguments.
- (apply function &rest args) [Function]
Conses all arguments but the last onto the last and applies FUNCTION to
the resulting argument list. Last argument must be a list.
- (apropos string) [Function]
Prints symbols whose print-names contain STRING as substring.
If STRING is a symbol its print name is used.
- (apropos-list string) [Function]
Returns, as a list, all symbols whose print-names contain STRING as substring.
If STRING is a symbol its print name is used.
- (assoc item alist &key (test (function eql)) test-not) [Function]
Returns the first pair in ALIST whose car is equal (in the sense of TEST) to
ITEM.
- (atom x) [Function]
Returns T if X is not a cons; NIL otherwise.
- (boundp symbol) [Function]
Returns T if the global variable named by SYMBOL has a value; NIL otherwise.
- (car list) [Function]
Returns the car of LIST. Returns NIL if LIST is NIL.
- (case keyform {({key | ({key}*)} {form}*)}*) [Macro]
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.
- (cdr list) [Function]
Returns the cdr of LIST. Returns NIL if LIST is NIL.
- (close stream) [Function]
Close file stream STREAM.
- (coerce x type) [Function]
Coerces X to an object of the type TYPE.
- (cond { (test {form}*) }*) [Macro]
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.
- (cons x y) [Function]
Returns a new cons (list node) whose car and cdr are X and Y, respectively.
- (consp x) [Function]
Returns T if X is a cons; NIL otherwise.
- (defmacro name defmacro-lambda-list [doc] {form}*) [Macro]
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).
- (defun name lambda-list [doc] {form}*) [Macro]
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).
- (do ({(var [init [step]])}*) (endtest {result}*) {tag |
statement}*) [Macro]
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.
- (do* ({(var [init [step]])}*) (endtest {result}*) {tag |
statement}*) [Macro]
Just like DO, but performs variable bindings and assignments in serial, just
like LET* and SETQ do.
- (dolist (var listform [result]) {tag | statement}*) [Macro]
Executes STATEMENTs, with VAR bound to each member of the list value of
LISTFORM. Then returns the value of RESULT (which defaults to NIL).
- (dotimes (var countform [result]) {tag | statement}*) [Macro]
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).
- (elt a &rest indices) [Function]
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.
- (eq x y) [Function]
Returns T if X and Y are the same identical object; NIL otherwise.
- (eql x y) [Function]
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.
- (equal x y) [Function]
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.
- (equalp x y) [Function]
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).
- (format destination control &rest args) [Function]
Very basic implementation of Common Lisp format function. Only A, S, D, F, E,
G, %, and d̃irectives are supported. D, % and c̃an take one argument, R, E
and G can take two.
- (funcall function &rest arguments) [Function]
Applies FUNCTION to the ARGUMENTs
- (function x) [Special Form]
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. Short form: #'x.
- (getf place indicator &optional default) [Function]
Returns property value of INDICATOR in PLACE, or DEFAULT if not found.
- (identity x) [Function]
Simply returns X.
- (if test then [else]) [Macro]
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.
- (last list) [Function]
Returns the last cons in LIST
- (length sequence) [Function]
Returns the length of SEQUENCE.
- (let ({var | (var [value])}*) {form}*) [Macro]
Initializes VARs, binding them to the values of VALUEs (which defaults to NIL)
all at once, then evaluates FORMs as a PROGN.
- (let* ({var | (var [value])}*) {form}*) [Macro]
Initializes VARs, binding them to the values of VALUEs (which defaults to NIL)
from left to right, then evaluates FORMs as a PROGN.
- (listp x) [Function]
Returns T if X is either a cons or NIL; NIL otherwise.
- (map result-type function sequence &rest more-sequences) [Function]
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.
- (mapc fun list &rest more-lists) [Function]
Applies FUN to successive cars of LISTs. Returns the first LIST.
- (mapcar fun list &rest more-lists) [Function]
Applies FUN to successive cars of LISTs and returns the results as a list.
- (mapl fun list &rest more-lists) [Function]
Applies FUN to successive cdrs of LISTs. Returns the first LIST.
- (maplist fun list &rest more-lists) [Function]
Applies FUN to successive cdrs of LISTs and returns the results as a list.
- (member item list &key (test (function eql)) test-not) [Function]
Returns the tail of LIST beginning with the first ITEM.
- (not item) [Function]
Test if object is nil.
- (nth n list) [Function]
Returns the N-th element of LIST, where the car of LIST is the zero-th
element.
- (nthcdr n list) [Function]
Returns the result of performing the CDR operation N times on LIST.
- (null x) [Function]
Returns T if X is NIL; NIL otherwise.
- (numberp x) [Function]
Returns T if X is any kind of number; NIL otherwise.
- (objectp x) [Function]
Returns T if X is an object, NIL otherwise.
- (open fname &key (direction :input)) [Function]
Opens file named by string or symbol FNAME. DIRECTION is :INPUT or :OUTPUT.
- (or {form}*) [Macro]
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.
- (prin1 object &optional (stream *standard-output*)) [Function]
Prints OBJECT in the most readable representation. Returns OBJECT.
- (princ object &optional (stream *standard-output*)) [Function]
Prints OBJECT without escape characters. Returns OBJECT.
- (print object &optional (stream *standard-output*)) [Function]
Outputs a newline character, and then prints OBJECT in the most readable
representation. Returns OBJECT.
- (prog ({var | (var [init])}*) {tag | statement}*) [Macro]
Binds VARs in parallel, and then executes STATEMENTs.
- (prog* ({var | (var [init])}*) {tag | statement}*) [Macro]
Binds VARs sequentially, and then executes STATEMENTs.
- (prog1 first {form}*) [Macro]
Evaluates FIRST and FORMs in order, and returns the value of FIRST.
- (prog2 first second {forms}*) [Macro]
Evaluates FIRST, SECOND, and FORMs in order, and returns the value
of SECOND.
- (progn {form}*) [Macro]
Evaluates FORMs in order, and returns whatever the last FORM returns.
- (provide name) [Function]
Adds NAME to the list of modules.
- (quote x) [Special Form]
Returns X without evaluating it. Short form: or 'x.
- (read &optional (stream *standard-input*) (eof-value nil) (recursivep nil)) [Function]
Reads and returns the next object from STREAM.
- (reduce function sequence &key initial-value) [Function]
Combines all the elements of SEQUENCE using a binary operation FUNCTION. If
INITIAL-VALUE is supplied it is logically placed before SEQUENCE.
- (remove item list &key (test (function eql)) test-not) [Function]
Returns a copy of LIST with ITEM removed.
- (remove-if test list) [Function]
Returns a copy of LIST with elements satisfying TEST removed.
- (remove-if-not test list) [Function]
Returns a copy of LIST with elements not satisfying TEST removed.
- (require name) [Function]
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.
- (return [result]) [Macro]
Returns from the lexically surrounding PROG construct. The value of RESULT,
which defaults to NIL, is returned as the value of the PROG construct.
- (reverse list) [Function]
Returns a new list containing the same elements as LIST but in
reverse order.
- (set symbol value) [Function]
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.
- (setf {place newvalue}*) [Macro]
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 a symbol that names
a variable or function call form whose first element is the name of one of the
following functions: nth, aref, subarray, sublist, select, elt, get,
symbol-value, symbol-plist, documentation, slot-value, or c?r c??r c???r c????r
where '?' stands for either 'a' or 'd'. defsetf can be used to define new setf
methods.
- (setq {var form}*) [Macro]
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.
- (string sym) [Function]
Returns print-name of SYM if SYM is a symbol, or SYM if SYM is a.
- (stringp x) [Function]
Returns T if X is a string; NIL otherwise.
- (sublis alist tree &key (test (function eql)) test-not) [Function]
Substitutes from ALIST for subtrees of TREE nondestructively.
- (subst new old tree &key (test (function eql)) test-not) [Function]
Substitutes NEW for subtrees of TREE that match OLD.
- (symbol-name symbol) [Function]
Returns the print name of the symbol SYMBOL.
- (symbol-plist symbol) [Function]
Returns the property list of SYMBOL.
- (symbol-value symbol) [Function]
Returns the current global value of the variable named by SYMBOL.
- (symbolp x) [Function]
Returns T if X is a symbol; NIL otherwise.
- (terpri &optional (stream *standard-output*)) [Function]
Outputs a newline character.
- (time form) [Macro]
Form is evaluated and its result returned. In addition the time required
for the evaluation is printed.
- (type-of x) [Function]
Returns the type of X.
- (unless test {form}*) [Macro]
If TEST evaluates to NIL evaluates FORMs as a PROGN. If not, returns NIL.
- (unwind-protect protected-form {cleanup-form}*) [Macro]
Evaluates PROTECTED-FORM and returns whatever it returned. Guarantees that
CLEANUP-FORMs be always evaluated before exiting from the UNWIND-PROTECT
form.
- (when test {form}*) [Macro]
If TEST evaluates to non-NIL evaluates FORMs as a PROGN. If not, returns NIL.