From 327abd604003109c3578d9509c0e1153c83652a5 Mon Sep 17 00:00:00 2001 From: tailor Date: Mon, 30 Jun 2008 23:24:43 +0200 Subject: [PATCH] improved layout --- DATE.tex | 2 +- REVISION.tex | 2 +- TODO | 2 - clqr-arrays.tex | 84 +++++-- clqr-characters.tex | 65 +++-- clqr-clos.tex | 103 ++++++-- clqr-compiler.tex | 131 ++++++++-- clqr-conditions-and-errors.tex | 96 +++++-- clqr-conses.tex | 151 ++++++++--- clqr-control-structure.tex | 361 +++++++++++++++++++++------ clqr-environment.tex | 34 ++- clqr-hash-tables.tex | 36 ++- clqr-input-output.tex | 509 +++++++++++++++++++++++++++++++------- clqr-numbers.tex | 287 +++++++++++++++------ clqr-packages-and-symbols.tex | 116 +++++++-- clqr-sequences.tex | 104 ++++++-- clqr-strings.tex | 32 ++- clqr-structures.tex | 14 +- clqr-system-types-and-classes.tex | 67 ++++- clqr.tex | 78 +++++- 20 files changed, 1838 insertions(+), 436 deletions(-) diff --git a/DATE.tex b/DATE.tex index dc8144a..d2b11a4 100644 --- a/DATE.tex +++ b/DATE.tex @@ -1 +1 @@ -2008-06-27 \ No newline at end of file +2008-06-30 \ No newline at end of file diff --git a/REVISION.tex b/REVISION.tex index 25bf17f..dec2bf5 100644 --- a/REVISION.tex +++ b/REVISION.tex @@ -1 +1 @@ -18 \ No newline at end of file +19 \ No newline at end of file diff --git a/TODO b/TODO index a540f5d..32fbbfb 100644 --- a/TODO +++ b/TODO @@ -1,7 +1,5 @@ * find better bold <, >, \, {, } -* snapping-in explanation starts - * FINAL TESTS diff --git a/clqr-arrays.tex b/clqr-arrays.tex index bb4d186..489674e 100644 --- a/clqr-arrays.tex +++ b/clqr-arrays.tex @@ -23,15 +23,21 @@ (\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})}{\}}} + (\FU*{ARRAY-HAS-FILL-POINTER-P} \VAR{ array})}{.}} + { Return \retval{\T} if \VAR{array} is adjustable/has a fill pointer, resp. + } \IT{(\FU*{ARRAY-IN-BOUNDS-P} \VAR{array} \Op{\VAR{subscripts}})} + { Return \retval{\T} if \VAR{subscripts} are in \VAR{array}'s bounds. + } \end{LIST} @@ -43,7 +49,7 @@ \IT{(\xorGOO{\FU*{MAKE-ARRAY}\\ \FU*{ADJUST-ARRAY} \VAR{ array}}{\}} - \VAR{dimensions}\\ + \VAR{dimensions} \orGOO{\kwd{:element-type} \VAR{ type}\DF{\T}\\ \kwd{:adjustable} \VAR{ bool}\DF{\NIL}\\ \kwd{:fill-pointer } \Goo{\VAR{num}\XOR\VAR{bool}}\DF{\NIL}\\ @@ -51,43 +57,66 @@ \kwd{:initial-contents} \VAR{ seq}\\ \kwd{:displaced-to} \xorGOO{\VAR{array}\\\VAR{bool}\DF{\NIL}}{\}} \Op{\kwd{:displaced-index-offset } \VAR{i}\DF{0}}}{.}}{\}})} + { Return fresh, or readjust, resp., \retval{vector or array of dimension(s) \VAR{dim}}. + } - \IT{(\kwd*{AREF} \VAR{array} \OP{\VAR{subscripts}})} Return + \IT{(\kwd*{AREF} \VAR{array} \OP{\VAR{subscripts}})} + { + Return \retval{array element} pointed to by \VAR{subscripts}. \kwd{setf}able. + } \IT{(\FU*{ROW-MAJOR-AREF} \VAR{array} \VAR{i})} + { Return \retval{\VAR{i}th element} of \VAR{array} in row-major order. + } \IT{(\FU*{ARRAY-ROW-MAJOR-INDEX} \VAR{array} \VAR{subscripts})} + { \retval{Index} in row-major order of element denoted by \VAR{subscripts}. + } - \IT{(\FU*{ARRAY-DIMENSIONS} \VAR{array})} + \IT{(\FU*{ARRAY-DIMENSIONS} \VAR{array})} + { \retval{List} containing \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})} + \IT{(\FU*{ARRAY-TOTAL-SIZE} \VAR{array})} + { \retval{Number of elements} in \VAR{array}. + } - \IT{(\FU*{ARRAY-DISPLACEMENT} \VAR{array})} + \IT{(\FU*{ARRAY-DISPLACEMENT} \VAR{array})} + { \retval{Target array} and \retval{offset}. + } - \IT{(\FU*{ARRAY-RANK} \VAR{array})} + \IT{(\FU*{ARRAY-RANK} \VAR{array})} + { \retval{Number of dimensions} of \VAR{array}. + } \IT{\arrGOO{(\FU*{BIT} \VAR{ bit-array} \VAR{ subscripts})\\ - (\FU*{SBIT} \VAR{ simple-bit-array} \VAR{ subscripts})}{\}}} + (\FU*{SBIT} \VAR{ simple-bit-array} \VAR{ subscripts})}{.}} + { Return \retval{element} of \VAR{bit-array} or of \VAR{simple-bit-array}. \kwd{setf}able. + } \IT{(\FU*{BIT-NOT} \VAR{bit-array} \Op{\VAR{arg}\DF{\NIL}})} + { Return \retval{result} of bit-wise negation of \VAR{bit-array}. If \VAR{arg} is a bit array, put result there. If \VAR{arg} is \T, put result in \VAR{bit-array}. If \VAR{arg} is \NIL, make a new array for result. + } \IT{(\xorGOO{\FU*{BIT-AND}\\ \FU*{BIT-ANDC1}\\ @@ -100,20 +129,28 @@ \FU*{BIT-ORC2}\\ \FU*{BIT-XOR}}{\}} \VAR{bit-array-a} \VAR{bit-array-b} \Op{\VAR{arg}\DF{\NIL}})} + { Return \retval{result} of bit-wise logical operations on \VAR{bit-array-a} and \VAR{bit-array-b}. If \VAR{arg} is a bit array, put result there. If \VAR{arg} is \T, put result in \VAR{bit-array-a}. If \VAR{arg} is \NIL, make a new array for result. + } - \IT{\CNS*{ARRAY-RANK-LIMIT}} + \IT{\CNS*{ARRAY-RANK-LIMIT}} + { Upper bound of array rank, $\geq 8$. + } - \IT{\CNS*{ARRAY-DIMENSION-LIMIT}} + \IT{\CNS*{ARRAY-DIMENSION-LIMIT}} + { Upper bound of an array dimension, $\geq 1024$. + } - \IT{\CNS*{ARRAY-TOTAL-SIZE-LIMIT}} + \IT{\CNS*{ARRAY-TOTAL-SIZE-LIMIT}} + { Upper bound of array size, $\geq 1024$. + } \end{LIST} @@ -127,30 +164,43 @@ s.\ \ref{section:Sequences}. \begin{LIST}{1cm} - \IT{(\FU*{VECTOR} \OPn{\VAR{foo}})} + \IT{(\FU*{VECTOR} \OPn{\VAR{foo}})} + { Return fresh \retval{vector of \VAR{foo}s}. + } - \IT{(\kwd*{SVREF} \VAR{vector} \VAR{i})} + \IT{(\kwd*{SVREF} \VAR{vector} \VAR{i})} + { Return \retval{\VAR{i}th element} of \VAR{vector}. \kwd{setf}able. + } - \IT{(\FU*{VECTOR-PUSH} \VAR{foo} \VAR{vector})} + \IT{(\FU*{VECTOR-PUSH} \VAR{foo} \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} \VAR{vector} \Op{\VAR{num}})} + \IT{(\FU*{VECTOR-PUSH-EXTEND} \VAR{foo} \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} \VAR{vector})} + \IT{(\FU*{VECTOR-POP} \VAR{vector})} + { Return \retval{element of \VAR{vector}} its fillpointer points to after decrementation. + } - \IT{(\FU*{FILL-POINTER} \VAR{vector})} + \IT{(\FU*{FILL-POINTER} \VAR{vector})} + { Return \retval{fill pointer} of \VAR{vector}. \kwd{setf}able. + } \end{LIST} diff --git a/clqr-characters.tex b/clqr-characters.tex index e852109..0edb51d 100644 --- a/clqr-characters.tex +++ b/clqr-characters.tex @@ -14,41 +14,55 @@ \begin{LIST}{1cm} \IT{\arrGOO{(\FU*{CHARACTERP} \VAR{ foo})\\ - (\FU*{STANDARD-CHAR-P} \VAR{ char})}{\}}} + (\FU*{STANDARD-CHAR-P} \VAR{ char})}{.}} + { Return \retval{\T} if \VAR{foo} is of indicated type. + } \IT{\arrGOO{(\FU*{GRAPHIC-CHAR-P} \VAR{ char})\\ (\FU*{ALPHA-CHAR-P} \VAR{ char})\\ - (\FU*{ALPHANUMERICP} \VAR{ char})}{\}}} + (\FU*{ALPHANUMERICP} \VAR{ char})}{.}} + { \retval{\T} if \VAR{char} is visible, alphabetic, or alphanumeric, resp. + } \IT{\arrGOO{(\FU*{UPPER-CASE-P} \VAR{ char})\\ (\FU*{LOWER-CASE-P} \VAR{ char})\\ - (\FU*{BOTH-CASE-P} \VAR{ char})}{\}}} + (\FU*{BOTH-CASE-P} \VAR{ char})}{.}} + { Return \retval{\T} if \VAR{char} is uppercase, lowercase, or able to be in another case, resp. + } \IT{(\FU*{DIGIT-CHAR-P} \VAR{char} \VAR{radix}\DF{10})} + { Return \retval{its weight} if \VAR{char} is a digit, or \retval{\NIL} otherwise. + } \IT{\arrGOO{(\FU*{CHAR=}\RP{\VAR{ character}})\\(\FU*{CHAR/=}\RP{\VAR{ - character}})}{\}}} + character}})}{.}} + { Return \retval{\T} if all \VAR{character}s, or none, resp., are equal. + } \IT{\arrGOO{(\FU*{CHAR-EQUAL}\RP{\VAR{ - character}})\\(\FU*{CHAR-NOT-EQUAL}\RP{\VAR{ character}})}{\}}} + character}})\\(\FU*{CHAR-NOT-EQUAL}\RP{\VAR{ + character}})}{.}} + { Return \retval{\T} if all \VAR{character}s, or none, resp., are equal ignoring case. + } \IT{\arrGOO{(\FU{CHAR\boldmath$>$}\RP{\VAR{ character}})\\(\FU{CHAR\boldmath$>=$}\RP{\VAR{ character}})\\(\FU{CHAR\boldmath$<$}\RP{\VAR{ character}})\\(\FU{CHAR\boldmath$<=$}\RP{\VAR{ - character}})}{\}}} + character}})}{.}} + { \index{char>@CHAR$>$}% \index{char>=@CHAR$>=$}% \index{char<@CHAR$<$}% @@ -56,45 +70,66 @@ Return \retval{\T} if \VAR{character}s are monotonically decreasing, monotonically non-increasing, monotonically increasing, or monotonically non-decreasing, resp. + } \IT{\arrGOO{ (\FU*{CHAR-GREATERP}\RP{\VAR{ character}})\\ (\FU*{CHAR-NOT-LESSP}\RP{\VAR{ character}})\\ (\FU*{CHAR-LESSP}\RP{\VAR{ character}})\\ - (\FU*{CHAR-NOT-GREATERP}\RP{\VAR{ character}})}{\}}} + (\FU*{CHAR-NOT-GREATERP}\RP{\VAR{ character}})}{.}} + { Return \retval{\T} if \VAR{character}s are monotonically decreasing, monotonically non-increasing, monotonically increasing, or monotonically non-decreasing, resp., ignoring case. + } \IT{\arrGOO{(\FU*{CHAR-UPCASE} \VAR{ character})\\ - (\FU*{CHAR-DOWNCASE} \VAR{ character})}{\}}} + (\FU*{CHAR-DOWNCASE} \VAR{ character})}{.}} + { Return corresponding uppercase/lowercase \retval{character}, resp. + } - \IT{(\kwd*{CHAR-INT} \VAR{character})} + \IT{(\kwd*{CHAR-INT} \VAR{character})} + { Return \retval{integer} encoding \VAR{character}. + } \IT{(\FU*{DIGIT-CHAR} \VAR{i} \Op{\VAR{radix}\DF{10}})} + { \retval{Character} representing digit \VAR{i}. + } - \IT{(\FU*{CHAR-NAME} \VAR{character})} + \IT{(\FU*{CHAR-NAME} \VAR{character})} + { Return \retval{name} of \VAR{character} if there is one, or \retval{\NIL}. + } - \IT{(\FU*{NAME-CHAR} \VAR{name})} + \IT{(\FU*{NAME-CHAR} \VAR{name})} + { Return \retval{character} with \VAR{name} if there is one, or \retval{\NIL}. + } - \IT{(\FU*{CHAR-CODE} \VAR{character})} + \IT{(\FU*{CHAR-CODE} \VAR{character})} + { Return \retval{code of \VAR{character}}. + } - \IT{(\FU*{CODE-CHAR} \VAR{code})} + \IT{(\FU*{CODE-CHAR} \VAR{code})} + { \retval{Character} with \VAR{code}. + } - \IT{\CNS*{CHAR-CODE-LIMIT}} + \IT{\CNS*{CHAR-CODE-LIMIT}} + { Upper bound of (\FU{CHAR-CODE} \VAR{char}). + } - \IT{(\FU*{CHARACTER} \VAR{c})} + \IT{(\FU*{CHARACTER} \VAR{c})} + { Return \retval{\kwd{\#$\backslash$}\VAR{c}}. + } \end{LIST} diff --git a/clqr-clos.tex b/clqr-clos.tex index d4ab0c8..b106176 100644 --- a/clqr-clos.tex +++ b/clqr-clos.tex @@ -18,39 +18,56 @@ \begin{LIST}{1cm} \IT{(\GFU*{MAKE-INSTANCE} \VAR{class} \Goos{\kwd{:}\VAR{initarg} - \VAR{value}} \OPn{\kwd{:}\VAR{other-key}})} + \VAR{value}} \OPn{\kwd{:}\VAR{other-key}})} + { Make new \retval{instance of \VAR{class}}. + } - \IT{(\GFU*{INITIALIZE-INSTANCE} (\VAR{instance}))} + \IT{(\GFU*{INITIALIZE-INSTANCE} (\VAR{instance}))} + { Its primary method sets slots on behalf of \GFU*{MAKE-INSTANCE}. Return \retval{instance}. + } \IT{(\GFU*{REINITIALIZE-INSTANCE} \VAR{instance} \OP{\VAR{initargs} \Op{\VAR{other-args}}})} + { Change local slots of \retval{\VAR{instance}}. + } - \IT{(\FU*{SLOT-VALUE} \VAR{instance} \VAR{slot})} Return \retval{value + \IT{(\FU*{SLOT-VALUE} \VAR{instance} \VAR{slot})} + {Return \retval{value of \VAR{slot} in \VAR{instance}}. \kwd{SETF}able. + } \IT{(\SF*{WITH-SLOTS}(\Goos{\VAR{slot}\XOR(\VAR{var slot})}) \VAR{instance} \OPn{(\kwd{declare} \OPn{\VAR{decl}})} - \OPn{\VAR{form}})} + \OPn{\VAR{form}})} + { Evaluate \VAR{form}s with slots of \VAR{instance} locally visible as \VAR{slot}s or \VAR{var}s. + } - \IT{(\GFU*{CLASS-NAME} \VAR{class})} + \IT{(\GFU*{CLASS-NAME} \VAR{class})} + { \retval{Name of \VAR{class}}. + } - \IT{(\kwd*{CLASS-OF} \VAR{foo})} + \IT{(\kwd*{CLASS-OF} \VAR{foo})} + { \retval{Class} \VAR{foo} is an instance of. + } \IT{(\FU*{FIND-CLASS} \VAR{symbol} \OP{\VAR{errorp}\DF{\T} - \Op{\VAR{environment}}})} + \Op{\VAR{environment}}})} + { Return \retval{class object} named \VAR{symbol}. \kwd{setf}able. + } - \IT{(\kwd*{MAKE-INSTANCES-OBSOLETE} \VAR{class})} + \IT{(\kwd*{MAKE-INSTANCES-OBSOLETE} \VAR{class})} + { Update instances of \VAR{class}. - + } \IT{(\SF*{DEFCLASS} \VAR{class-name} (\OPn{\VAR{superclass}}) (\GOOs{\VAR{slot}\XOR (\VAR{slot} @@ -62,37 +79,52 @@ \kwd{:initform} \VAR{ form}\\ \kwd{:type} \VAR{ type}\\ \kwd{:documentation} \VAR{ string}}{\}})}) - \orGOO{(\kwd{:default-initargs} \Goos{\VAR{name}\VAR{ value}})\\ (\kwd{:documentation} \VAR{ string})\\ (\kwd{:metaclass} \VAR{ name})}{\}})} + { Define \retval{class \VAR{ class-name}} as a subclass of \VAR{superclass}es. + } - \IT{(\GFU*{CHANGE-CLASS} \VAR{instance} \VAR{new-class} \Op{\VAR{arg}})} + \IT{(\GFU*{CHANGE-CLASS} \VAR{instance} \VAR{new-class} + \Op{\VAR{arg}})} + { Change class of \retval{\VAR{instance}} to \VAR{new-class}. + } \IT{(\GFU*{UPDATE-INSTANCE-FOR-DIFFERENT-CLASS} \VAR{previous} \VAR{current} \Op{\VAR{initargs}} \Op{\VAR{keyargs}})} + { Called by \kwd{change-class}. + } \IT{(\GFU*{UPDATE-INSTANCE-FOR-REDEFINED-CLASS} \VAR{instances} \VAR{added-slots} \VAR{discarded-slots} \VAR{property-list \Op{\VAR{initargs}} \Op{\VAR{other-args}}})} + { Called by \kwd{make-instances-obsolete}. + } \IT{(\GFU*{SHARED-INITIALIZE} \VAR{instance} \VAR{slots} - \Op{\VAR{init-args}} \Op{\VAR{other-keyargs}})} + \Op{\VAR{init-args}} \Op{\VAR{other-keyargs}})} + { Used to fill \VAR{instance}'s \VAR{slots} using \VAR{init-args} and \kwd{:initform} forms. + } \IT{(\GFU*{SLOT-MISSING} \VAR{class} \VAR{object} \VAR{slot} - \Goo{\kwd{setf} \kwd{slot-boundp} \kwd{slot-makunbound}} \Op{\VAR{value}})} + \Goo{\kwd{setf} \kwd{slot-boundp} \kwd{slot-makunbound}} + \Op{\VAR{value}})} + { Called in case of attempted access to missing \VAR{slot}. Default method signals an error. + } - \IT{(\GFU*{SLOT-UNBOUND} \VAR{class} \VAR{instance} \VAR{slot}))} + \IT{(\GFU*{SLOT-UNBOUND} \VAR{class} \VAR{instance} \VAR{slot})} + { Called by \kwd{slot-value} in case of unbound \VAR{slot}. Default method signals \kwd{unbound-slot}. + } \end{LIST} @@ -103,7 +135,9 @@ \begin{LIST}{1cm} \IT{(\FU*{NEXT-METHOD-P})} + { \retval{\T} if enclosing method has a next method. + } \IT{(\SF*{DEFGENERIC} \xorGOO{\VAR{name}\\ (\kwd{setf} \VAR{ name})}{\}} @@ -121,9 +155,12 @@ (\kwd{:generic-function-class} \VAR{ class})\\ (\kwd{:method-class} \VAR{ class})\\ (\kwd{:method-combination} \VAR{ c-type} \OPn{\VAR{ arg}})\\ - \OPn{(\kwd{:method} \VAR{ defmethod-symbol} \OPn{\VAR{ defmethod-arg}})}}{\}})} + \OPn{(\kwd{:method} \VAR{ defmethod-symbol} \OPn{\VAR{ + defmethod-arg}})}}{\}})} + { Define \retval{generic function \VAR{name}}. For \VAR{c-type} see s.\ \ref{section:Method Combination Types}. + } \IT{(\FU*{ENSURE-GENERIC-FUNCTION} \xorGOO{\VAR{name}\\ (\kwd{setf} \VAR{ name})}{\}} @@ -136,8 +173,10 @@ \kwd{:lambda-list} \VAR{ lambda-list}\\ \kwd{:method-class} \VAR{ class}\\ \kwd{:method-combination} \VAR{ c-type} \OPn{\VAR{ arg}}}{\}})} + { Define or modify \retval{generic function \VAR{name}}. For \VAR{c-type} see s.\ \ref{section:Method Combination Types}. + } \IT{(\SF*{DEFMETHOD} \xorGOO{\VAR{bar}\\ (\kwd{setf} \VAR{ bar})}{\}} @@ -156,57 +195,81 @@ \OP{\kwd*{\&aux}\Goos{\VAR{var}\XOR(\VAR{var} \Op{\VAR{init}})}}) \orGOO{\OPn{(\kwd{declare} \OPn{\VAR{ decl}})}\\ \VAR{documentation}}{\}} - \OPn{\VAR{form}})} + \OPn{\VAR{form}})} + { Define \retval{new method} for generic function \VAR{bar}. \VAR{spec-var}s specialize to either being of \VAR{class} or being \kwd{eql} \VAR{foo}, resp. On invocation, \VAR{var}s and \VAR{spec-var}s of the \retval{new method} act like parameters of a function with body \VAR{foo}. + } \IT{(\xorGOO{\GFU*{ADD-METHOD}\\ \GFU*{REMOVE-METHOD}}{\}}\VAR{generic-function} \VAR{method})} + { Add, or remove, resp., \VAR{method} from \retval{\VAR{generic-function}}. + } \IT{(\FU*{CALL-NEXT-METHOD} \Op{\VAR{args}\DF{current args}})} + { From within a method, call next method with \VAR{args}, return \retval{its values}. + } \IT{(\GFU*{NO-APPLICABLE-METHOD} \VAR{generic-function} \OPn{\VAR{arg}})} + { Called on invocation of \VAR{generic-function} if there is no applicable method. + } \IT{(\xorGOO{(\FU*{INVALID-METHOD-ERROR} \VAR{ method}\\ \FU*{METHOD-COMBINATION-ERROR})}{\}}% \VAR{control} \OPn{\VAR{arg}})} + { Signal \kwd{error} on applicable method, or on method combination, with invalid qualifiers. See p.\ \pageref{section:Format}. + } \IT{(\SF*{CALL-METHOD} \orGOO{\VAR{method}\\ (\SF*{MAKE-METHOD} \VAR{ form})}{\}} \Op{\VAR{next-methods}})} + { Call \VAR{method}, return \retval{its values}. + } \IT{(\GFU*{NO-NEXT-METHOD} \VAR{generic-function} \VAR{method} \OPn{\VAR{arg}})} + { Called on invocation of \kwd{call-next-method} if there is no next method. + } \IT{(\GFU*{FUNCTION-KEYWORDS} \VAR{method})} + { \retval{Keyword parameters} of method. + } \IT{(\GFU*{ALLOCATE-INSTANCE} \VAR{class} \OP{\VAR{initargs} \Op{\VAR{other-args}}})} + { Return uninitialized \retval{instance} of \VAR{class}. + } \IT{(\GFU*{METHOD-QUALIFIERS} \VAR{method})} + { List of qualifiers of \VAR{method}. + } \IT{(\GFU*{FIND-METHOD} \VAR{generic-function} \VAR{qualifiers} \VAR{specializers} \Op{\VAR{error}\DF{\T}})} + { Return suitable \retval{method}, or \retval{\NIL}. + } \IT{(\GFU*{COMPUTE-APPLICABLE-METHODS} \VAR{generic-function} \VAR{args})} + { \retval{Set of methods} suitable for \VAR{args}. + } \end{LIST} @@ -226,20 +289,26 @@ \kwd*{MAX}\\ \kwd*{MIN}\\ \kwd*{+}}{\}}} + { Built-in method combination types. + } \IT{\kwd*{STANDARD}} + { Standard method combination type, also used if no method combination type is given. + } \IT{(\SF*{DEFINE-METHOD-COMBINATION} \VAR{c-type}\orGOO{% \kwd{:documentation} \VAR{ string}\\ \kwd{:identity-with-one-argument} \VAR{ bool}\DF{\NIL}\\ \kwd{:operator} \VAR{ operator}\DF{\VAR{name}}}{\}})} + { (Short form.) Define new method combination type \retval{\VAR{c-type}}. A call to a generic function using \VAR{c-type} is equivalent to (\VAR{c-type} \OPn{\VAR{applicable-method}}). + } \IT{(\SF*{DEFINE-METHOD-COMBINATION} \VAR{c-type} (\OPn{\VAR{fu-arg}}) @@ -255,11 +324,13 @@ \orGOO{\OPn{(\kwd{declare} \OPn{\VAR{ decl}})}\\ \VAR{documentation}}{\}}% \OPn{\VAR{body}})} + { (Long form.) A call to a generic function using \VAR{c-type} is equivalent to a call to the forms returned by \VAR{body}. Lambda list (\OPn{\VAR{fu-arg}}) and (\OPn{\VAR{method-combination-arg}}) according to \VAR{fu-arg} on p.\ \pageref{section:Functions}, the latter enhanced by an optional \kwd{\&whole} argument. + } \end{LIST} diff --git a/clqr-compiler.tex b/clqr-compiler.tex index d19e3b8..a6c3353 100644 --- a/clqr-compiler.tex +++ b/clqr-compiler.tex @@ -17,11 +17,15 @@ \begin{LIST}{1cm} - \IT{(\FU*{SPECIAL-OPERATOR-P} \VAR{foo})} + \IT{(\FU*{SPECIAL-OPERATOR-P} \VAR{foo})} + { \retval{\T} if \VAR{foo} is a special operator. + } \IT{(\FU*{COMPILED-FUNCTION-P} \VAR{foo})} + { \retval{\T} if \VAR{foo} is of type \kwd{compiled-function}. + } \end{LIST} @@ -36,8 +40,10 @@ \xorGOO{\NIL\\ \VAR{name}}{\}} \Op{\VAR{definition}})} + { Return \retval{compiled function} or its \VAR{name}, \retvalii{\T} in case of warnings, and \retvaliii{\T} in case of failure. + } \IT{(\FU*{COMPILE-FILE} \VAR{file} \orGOO{\kwd{:output-file}\VAR{ out-path}\\ @@ -45,79 +51,110 @@ \kwd{:print}\VAR{ bool}\DF{\kwd{*compile-print*}}\\ \kwd{:external-format} \VAR{ file-format}\DF{\kwd{:default}}}{\}})} + { Write compiled contents of \VAR{path} to \VAR{out-path}. Return \retval{true output path} or \retval{\NIL}, \retvalii{\T} in case of warnings or errors, \retvaliii{\T} in case of warnings or errors excluding style warnings. + } \IT{\arrGOO{\V*{*compile-file-pathname*}\DF{\NIL}\\ \V*{*compile-file-truename*}\DF{\NIL}}{\}}} + { Input file used by \FU{compile-file}. + } \IT{\arrGOO{\V*{*compile-print*}\\ \V*{*compile-verbose*}}{\}}} + { Defaults used in \FU{compile-file}. - + } + \IT{(\FU*{COMPILE-FILE-PATHNAME} \Op{\kwd{:pathname} \VAR{path}})} + { \retval{Pathname} \FU{COMPILE-FILE} writes to. + } \IT{(\FU*{LOAD} \VAR{path} \orGOO{\kwd{:verbose} \VAR{ bool}\DF{\kwd{*load-verbose*}}\\ \kwd{:print} \VAR{ bool}\DF{\kwd{*load-print*}}\\ \kwd{:if-does-not-exist} \VAR{ bool}\DF{\T}\\ - \kwd{:external-format} \VAR{ file-format}\DF{\kwd{:default}}}{\}})} + \kwd{:external-format} \VAR{ + file-format}\DF{\kwd{:default}}}{\}})} + { Load source or compiled file. Return \retval{\T} if successful. + } \IT{\arrGOO{\V*{*load-pathname*}\DF{\NIL}\\ \V*{*load-truename*}\DF{\NIL}}{\}}} + { Input file used by \FU{load}. + } \IT{\arrGOO{\V*{*load-print*}\\ \V*{*load-verbose*}}{\}}} + { Defaults used in \FU{load}. - + } + \IT{(\SF*{EVAL-WHEN} (% \orGOO{\kwd{:compile-toplevel}\\ \kwd{:load-toplevel}\\ \kwd{:execute}}{\}}) \OPn{\VAR{form}})} + { Evaluate \VAR{form}s returning \retval{values of last \VAR{form}} if \SF{EVAL-WHEN} is in the top-level of a file being compiled, in the top-level of a compiled file being loaded, or anywhere, resp. + } \IT{(\kwd*{WITH-COMPILATION-UNIT} (\Op{\kwd{:override} \VAR{bool}\DF{\NIL}}) \OPn{\VAR{form}})} + { Return \retval{values of \VAR{form}s}. Warnings deferred by the compiler until end of compilation are deferred until the end of evaluation of \VAR{form}s. + } \IT{(\SF*{LOAD-TIME-VALUE} \VAR{form} \Op{\VAR{read-only}\DF{\NIL}})} + { Evaluate \VAR{form} at compile time and treat \retval{its value} as literal at run time. + } \IT{(\SF*{QUOTE} \VAR{foo})} + { Return \retval{unevaluated \VAR{foo}}. + } \IT{(\GFU*{MAKE-LOAD-FORM} \VAR{foo} \Op{\VAR{environment}})} + { Make \retval{one or two forms} enabling \kwd{load} to construct something equvalent to \VAR{foo}. + } \IT{(\FU*{MAKE-LOAD-FORM-SAVING-SLOTS} \VAR{foo} \orGOO{\kwd{:slot-names} \VAR{ slots}\\ - \kwd{:environment} \VAR{ environment}}{\}})} + \kwd{:environment} \VAR{ environment}}{\}})} + { Make \retval{two forms} yielding something equvalent to \VAR{foo} but preserving only \VAR{slots}. + } \IT{\arrGOO{(\FU*{MACRO-FUNCTION} \VAR{ symbol } \Op{\VAR{environment}})\\ (\kwd*{COMPILER-MACRO-FUNCTION} \VAR{ name } - \Op{\VAR{environment}})}{\}}} + \Op{\VAR{environment}})}{.}} + { Return specified \retval{macro function}, or \retval{compiler macro function}, resp., if any. Return \retval{\NIL} otherwise. \kwd{setf}able. + } \IT{(\FU*{EVAL} \VAR{form})} + { Return \retval{values of \VAR{form}}. + } \end{LIST} @@ -129,73 +166,110 @@ \begin{LIST}{1cm} \IT{\Goo{\kwd*{*}\XOR\kwd*{**}\XOR\V*{***}}} + { Most recent primary result or the two preceding primary results, resp., printed in the REPL. - + } + \IT{\Goo{\kwd*{+}\XOR\kwd*{++}\XOR\V*{+++}}} + { Forms most recently evaluated in the REPL. - + } + \IT{\Goo{\kwd*{/}\XOR\kwd*{//}\XOR\V*{///}}} + { List of most recent results or of the two preceding results, resp., printed in the REPL. - + } + \IT{\kwd*{--}} + { Form currently being evaluated by the REPL. + } \IT{(\FU*{APROPOS} \VAR{string} \OPn{\VAR{package}})} + { Print interned symbols containig \VAR{string}. + } \IT{(\FU*{APROPOS-LIST} \VAR{string} \OPn{\VAR{package}})} + { \retval{List of interned symbols} containig \VAR{string}. + } \IT{(\FU*{DRIBBLE} \Op{\VAR{path}})} + { Save a record of interactive session to file at \VAR{path}. + } \IT{(\FU*{ED} \Op{\VAR{file-or-function}\DF{\NIL}})} + { Invoke editor if possible. + } \IT{(\xorGOO{\SF*{MACROEXPAND-1}\\ - \SF*{MACROEXPAND}}{\}}\VAR{form} \Op{\VAR{environment}})} + \SF*{MACROEXPAND}}{\}}\VAR{form} \Op{\VAR{environment}})} + { Return \retval{macro expansion}, once or entirely, resp., of \VAR{form} and \retvalii{\T} if \VAR{form} is a macro form. Return \retval{\VAR{form}} and \retvalii{\NIL} otherwise. + } \IT{\V*{*macroexpand-hook*}} + { Function called by \kwd{macroexpand-1} to generate macro expansions. + } \IT{(\SF*{TRACE} \OPn{\VAR{function}})} + { Cause \VAR{function}s to be traced. With no arguments, return \retval{list of traced functions}. + } \IT{(\SF*{UNTRACE} \OPn{\VAR{function}})} + { Stop \VAR{function}s, or all currently traced functions from being traced. + } - \IT{\V*{*trace-output*}} + \IT{\V*{*trace-output*}} + { Stream \kwd{trace} and \kwd{time} print their output on. - + } + \IT{(\SF*{STEP} \VAR{form})} + { Step through evaluation of \VAR{form}. Return \retval{values of \VAR{form}}. + } \IT{(\SF*{TIME} \OPn{\VAR{form}})} + { Evaluate \VAR{form}s and print timing information to \V{*trace-output*}. Return \retval{values of \VAR{form}s}. - + } \IT{(\FU*{INSPECT} \VAR{foo})} - Interactively give information about \VAR{foo}. + { + Interactively give information about \VAR{foo}. + } \IT{(\FU*{DESCRIBE} \VAR{foo} \Op{\VAR{stream}\DF{\kwd{*standard-output*}}})} + { Send information about \VAR{foo} to \VAR{stream}. + } \IT{(\GFU*{DESCRIBE-OBJECT} \VAR{foo} \Op{\VAR{stream}})} + { Send information about \VAR{foo} to \VAR{stream}. Not to be called by user. + } \IT{(\FU*{DISASSEMBLE} \VAR{function})} + { Send disassembled representation of \VAR{function} to \kwd{*standard-output*}. Return \retval{\NIL}. + } \end{LIST} @@ -206,7 +280,8 @@ \begin{LIST}{1cm} \IT{\arrGOO{(\FU*{PROCLAIM} \VAR{ decl})\\ - (\SF*{DECLAIM} \OPn{\VAR{ decl}})}{\}}} + (\SF*{DECLAIM} \OPn{\VAR{ decl}})}{.}} + { Globally make declaration(s) \VAR{decl}. \VAR{decl} can be: \kwd{declaration}, \kwd{type}, @@ -216,8 +291,10 @@ \kwd{optimize}, or \kwd{special}. See below. + } \IT{(\SF*{DECLARE} \OPn{\VAR{decl}})} + { Inside certain forms, locally make declarations \VAR{decl}. \VAR{decl} can be: \kwd{dynamic-extent}, \kwd{type}, @@ -229,31 +306,43 @@ \kwd{optimize}, or \kwd{special}. See below. - + } + \begin{LIST}{.5cm} - \IT{(\kwd*{DECLARATION} \OPn{foo})} + \IT{(\kwd*{DECLARATION} \OPn{foo})} + { Make \VAR{foo}s names of declarations. - + } + \IT{(\kwd*{DYNAMIC-EXTENT} \OPn{\VAR{var}} \OPn{(\kwd{function} \VAR{fu})})} + { Declare objects referred to by \VAR{var} or \VAR{fu} to have dynamic extent. + } + \IT{\arrGOO{(\kwd*{TYPE} \VAR{ type} \OPn{\VAR{ variable}})\\ (\kwd*{FTYPE} \VAR{ type} \OPn{\VAR{ function}})}{\}}} + { Declare \VAR{variable} or \VAR{function} to be of \VAR{type}. + } \IT{(\xorGOO{\kwd*{IGNORE}\\ \kwd*{IGNORABLE}}{\}}\xorGOO{% \VAR{var}\\ (\kwd{function} \VAR{ function})}{\}^{\!\!*}})} + { Suppress warnings about used/unused bindings. + } \IT{\arrGOO{(\kwd*{INLINE} \OPn{\VAR{ function}})\\ (\kwd*{NOTINLINE} \OPn{\VAR{ function}})}{\}}} + { Tell compiler to integrate/not to integrate, resp., called \VAR{function}s into the calling routine. + } \IT{(\kwd*{OPTIMIZE}\orGOO{% \kwd*{COMPILATION-SPEED}\XOR(\kwd*{COMPILATION-SPEED}\VAR{ n})\\ @@ -261,11 +350,15 @@ \kwd*{SAFETY}\XOR(\kwd*{SAFETY}\VAR{ n})\\ \kwd*{SPACE}\XOR(\kwd*{SPACE}\VAR{ n})\\ \kwd*{SPEED}\XOR(\kwd*{SPEED}\VAR{ n})}{\}})} + { Tell compiler how to optimize. $n=0$ means unimportant, $n=1$ is neutral, $n=3$ means important. + } - \IT{(\kwd*{SPECIAL} \OPn{\VAR{var}})} + \IT{(\kwd*{SPECIAL} \OPn{\VAR{var}})} + { Declare \VAR{var}s being dynamic. + } \end{LIST} \end{LIST} diff --git a/clqr-conditions-and-errors.tex b/clqr-conditions-and-errors.tex index b7c35d7..ef0a89c 100644 --- a/clqr-conditions-and-errors.tex +++ b/clqr-conditions-and-errors.tex @@ -73,47 +73,66 @@ \kwd{:type} \VAR{ type}}{\}})}{\}}) \orGOO{(\kwd{:default-initargs} \Goos{\VAR{name} \VAR{value}})\\ ({\kwd{:documentation} \VAR{ string}})\\ - (\kwd{:report} \VAR{ report-name})}{\}})} + (\kwd{:report} \VAR{ report-name})}{\}})} + { Define new condition type \retval{\VAR{name}}. + } - \IT{(\FU*{MAKE-CONDITION} \VAR{type} \OPn{\VAR{initarg-plist}})} + \IT{(\FU*{MAKE-CONDITION} \VAR{type} \OPn{\VAR{initarg-plist}})} + { Return \retval{new condition of \VAR{type}}. + } - \IT{(\FU*{UNWIND-PROTECT} \VAR{protected-form} \VAR{cleanup-form})} + \IT{(\FU*{UNWIND-PROTECT} \VAR{protected-form} \VAR{cleanup-form})} + { Evaluate \VAR{protected-form} and then, no matter how control leaves \VAR{protected-form}, \VAR{cleanup-form}. Return \retval{value of \VAR{protected-form}}. + } \IT{(\xorGOO{\FU*{SIGNAL}\\ \FU*{WARN}}{\}} \VAR{datum} \OPn{\VAR{arg}})} + { Signal \kwd{condition} or \kwd{warning}, resp., as denoted by \VAR{datum} and \VAR{arg}s. Return \retval{\NIL}. + } - \IT{(\FU*{ERROR} \VAR{datum} \OPn{\VAR{arg}})} + \IT{(\FU*{ERROR} \VAR{datum} \OPn{\VAR{arg}})} + { Signal condition as denoted by \VAR{datum} and \VAR{arg}s unless error is handled. + } \IT{(\FU*{CERROR} \VAR{control} \VAR{datum} \OPn{arg})} + { Signal correctable \kwd{simple-error} to debugger unless error is handled. Show \kwd{format} \VAR{control} (see p.\ \pageref{section:Format}) with the debugger's continue option. + } \IT{(\SF*{IGNORE-ERRORS} \OPn{\VAR{form}})} + { Return \retval{values of \VAR{form}s} or, in case of \kwd{error}s, \retval{\NIL} and the \retvalii{condition}. + } \IT{(\FU*{INVOKE-DEBUGGER} \VAR{condition})} + { Invoke debugger with \VAR{condition}. + } \IT{(\SF*{ASSERT} \VAR{test} \OP{(\OPn{\VAR{place}})\Op{\VAR{datum} \OPn{\VAR{arg}}})}} + { Signal correctable error denoted by \VAR{datum} and \VAR{arg}s if \VAR{test}, which may depend on \VAR{place}s, returns \NIL. Return \retval{\NIL}. + } \IT{(\SF*{HANDLER-CASE} \VAR{test} \OPn{(\VAR{type} (\VAR{condition-var}) \OPn{(\kwd{declare} \OPn{\VAR{decl}})} \OPn{\VAR{condition-form}})} \Op{\kwd{:no-error} (\OPn{\VAR{fu-arg}}) \OPn{(\kwd{declare} \OPn{\VAR{decl}})} - \OPn{\VAR{form}}})} + \OPn{\VAR{form}}})} + { If, on evaluation of \VAR{test}, a condition of \VAR{type} is signalled, return \retval{values of matching \VAR{condition-form}s} with \VAR{condition-var} bound to the condition. Without a condition, bind @@ -121,24 +140,31 @@ \VAR{form}s} or, without a \kwd{:no-error} clause, return \retval{value of \VAR{test}}. See p.\ \pageref{section:Functions} for (\OPn{\VAR{fu-arg}}). + } \IT{(\kwd*{HANDLER-BIND} (\OPn{(\VAR{condition-type} - \VAR{handler})}) \OPn{\VAR{form}})} + \VAR{handler})}) \OPn{\VAR{form}})} + { Evaluate \VAR{form}s with \VAR{condition-type}s dynamically bound to their respective \VAR{handler}. Return \retval{values of \VAR{form}s}. + } \IT{(\SF*{WITH-SIMPLE-RESTART} (\VAR{restart} \VAR{control} \OPn{\VAR{arg}}) \OPn{\VAR{form}})} + { If \VAR{restart} is not called from \VAR{form}s, return \retval{values of last \VAR{form}}. Otherwise return \retval{\NIL} and \retval{\T} and report restart using \kwd{format} \VAR{control} and \VAR{arg}s (see p.\ \pageref{section:Format}). + } \IT{(\SF*{WITH-CONDITION-RESTARTS} \VAR{condition-form} \VAR{restarts-form} \OPn{\VAR{form}})} + { Evaluate \VAR{form}s with restarts yielded from \VAR{restart-form} dynamically associated with condition yielded from \VAR{condition-form}. Return values of \VAR{form}s. + } \IT{(\SF*{RESTART-CASE} \VAR{test} \OPn{(\VAR{name} (\OPn{\VAR{fu-arg}})% \orGOO{\kwd{:interactive} @@ -146,85 +172,121 @@ \kwd{:report} \VAR{ form}\\ \kwd{:test} \VAR{ form}}{\}} \OPn{(\kwd{declare} \OPn{\VAR{decl}})} \OPn{form})})} + { Evaluate \VAR{test} with new restarts \VAR{name}. Return \retval{value of \VAR{test}} or, if any of the restarts is invoked, return \retval{value of its last \VAR{form}}. For \VAR{fu-arg}s see p.\ \pageref{section:Functions}. + } \IT{(\SF*{RESTART-BIND} (\OPn{(\VAR{restart} \VAR{restart-function}\orGOO{\kwd{:interactive-function} \VAR{ function}\\ \kwd{:report-function} \VAR{ function}\\ \kwd{:test-function} \VAR{ function}}{\}})}) \OPn{\VAR{form}})} + { Return \retval{value of \VAR{form}s} evaluated with \VAR{restart}s dynamically bound to \VAR{restart-function}s. + } \IT{\arrGOO{(\FU*{INVOKE-RESTART} \VAR{ foo} \OPn{\VAR{ arg}})\\ - (\FU*{INVOKE-RESTART-INTERACTIVELY} \VAR{ restart})}{\}}} + (\FU*{INVOKE-RESTART-INTERACTIVELY} \VAR{ restart})}{.}} + { Call function associated with \VAR{restart} with arguments given or prompted for, resp. If restart function returns, return \retval{its values}. + } \IT{(\xorGOO{\FU*{COMPUTE-RESTARTS}\\ \FU*{FIND-RESTART} \VAR{ name}}{\}} \Op{\VAR{condition}})} + { Return list of \retval{all restarts}, or innermost \retval{restart} \VAR{name}, resp., out of those either associated with \VAR{condition} or un-associated at all; or, without \VAR{condition}, out of all restarts. Return \retval{\NIL} if search is unsuccessful. + } \IT{(\FU*{RESTART-NAME} \VAR{restart})} + { \retval{Name of \VAR{restart}}. + } \IT{(\xorGOO{\FU*{ABORT}\\ \FU*{MUFFLE-WARNING}\\ \FU*{CONTINUE}\\ \FU*{STORE-VALUE} \VAR{ value}\\ \FU*{USE-VALUE} \VAR{ value}}{\}} \Op{\VAR{condition}})} + { Transfer control to innermost applicable restart with same name (i.e. \kwd{abort}, \ldots, \kwd{continue} \ldots) out of those either associated with \VAR{condition} or un-associated at all; or, without \VAR{condition}, out of all restarts. If no restart is found, signal \kwd{control-error} for \FU{abort} and \FU{muffle-warning}, or return \retval{\NIL} for the rest. + } - \IT{(\FU*{ARITHMETIC-ERROR-OPERANDS} \VAR{condition})} + \IT{(\FU*{ARITHMETIC-ERROR-OPERANDS} \VAR{condition})} + { \retval{List of operands} used in signalling operation. + } - \IT{(\FU*{ARITHMETIC-ERROR-OPERATION} \VAR{condition})} + \IT{(\FU*{ARITHMETIC-ERROR-OPERATION} \VAR{condition})} + { \retval{Function} used in signalling operation. + } - \IT{(\FU*{CELL-ERROR-NAME} \VAR{condition})} + \IT{(\FU*{CELL-ERROR-NAME} \VAR{condition})} + { \retval{Name of cell} which caused \VAR{condition}. + } - \IT{(\FU*{UNBOUND-SLOT-INSTANCE} \VAR{condition})} + \IT{(\FU*{UNBOUND-SLOT-INSTANCE} \VAR{condition})} + { \retval{Instance} with unbound slot which caused \VAR{condition}. + } - \IT{(\FU*{PACKAGE-ERROR-PACKAGE} \VAR{condition})} + \IT{(\FU*{PACKAGE-ERROR-PACKAGE} \VAR{condition})} + { \retval{Package} which caused \VAR{condition}. + } \IT{(\FU*{PRINT-NOT-READABLE-OBJECT} \VAR{condition})} + { The \retval{object} unprintable under \VAR{condition}. + } - \IT{(\FU*{FILE-ERROR-PATHNAME} \VAR{condition})} + \IT{(\FU*{FILE-ERROR-PATHNAME} \VAR{condition})} + { \retval{Path} which caused condition. + } - \IT{(\FU*{STREAM-ERROR-STREAM} \VAR{condition})} + \IT{(\FU*{STREAM-ERROR-STREAM} \VAR{condition})} + { \retval{Stream} which caused \VAR{condition}. + } \IT{\arrGOO{(\FU*{TYPE-ERROR-DATUM} \VAR{ condition})\\ - (\FU*{TYPE-ERROR-EXPECTED-TYPE} \VAR{ condition})}{\}}} + (\FU*{TYPE-ERROR-EXPECTED-TYPE} \VAR{ condition})}{.}} + { \retval{Datum} which caused \VAR{condition}, or its expected type, resp. + } \IT{\arrGOO{(\FU*{SIMPLE-CONDITION-FORMAT-CONTROL} \VAR{ condition})\\ - (\FU*{SIMPLE-CONDITION-FORMAT-ARGUMENTS} \VAR{ condition})}{\}}} + (\FU*{SIMPLE-CONDITION-FORMAT-ARGUMENTS} \VAR{ condition})}{.}} + { Return \retval{\kwd{format} control} or list of \retval{\kwd{format} arguments}, resp., of \VAR{condition}. + } \IT{\V*{*break-on-signals*}\DF{\NIL}} + { Condition debugger is to be invoked on. + } - \IT{\V*{*debugger-hook*}\DF{\NIL}} Function of condition and + \IT{\V*{*debugger-hook*}\DF{\NIL}} + {Function of condition and function itself. + } \end{LIST} diff --git a/clqr-conses.tex b/clqr-conses.tex index 7d89a41..6b0f4cc 100644 --- a/clqr-conses.tex +++ b/clqr-conses.tex @@ -18,18 +18,28 @@ \IT{\arrGOO{(\FU*{CONSP} \VAR{ foo})\\ (\FU*{LISTP} \VAR{ foo})}{\}}} + { Return \retval{\T} if \VAR{foo} is either \T\ or a \kwd{cons}/\kwd{list}. + } \IT{(\FU*{ENDP} \VAR{list})} + { Return \retval{\T} if \VAR{list} is \LIT{()}. + } - \IT{(\FU*{ATOM} \VAR{foo})} Return \retval{\T} if \VAR{foo} is not a + \IT{(\FU*{ATOM} \VAR{foo})} + {Return \retval{\T} if \VAR{foo} is not a \kwd{cons}. + } - \IT{(\FU*{NULL} \VAR{foo})} Return \retval{\T} if \VAR{foo} is \NIL. + \IT{(\FU*{NULL} \VAR{foo})} + {Return \retval{\T} if \VAR{foo} is \NIL. + } - \IT{(\FU*{TAILP} \VAR{foo} \VAR{list})} + \IT{(\FU*{TAILP} \VAR{foo} \VAR{list})} + { Return \retval{\T} if \VAR{foo} is a tail of \VAR{list}. + } \IT{(\xorGOO{\FU*{MEMBER}\\ \FU*{MEMBER-IF }\VAR{predicate}\\ @@ -37,16 +47,20 @@ \VAR{foo} \VAR{list} \orGOO{\kwd{:test} \VAR{ function}\\ \kwd{:test-not} \VAR{ function}\\ - \kwd{:key} \VAR{ function}}{\}})} + \kwd{:key} \VAR{ function}}{.})} + { Return \retval{tail of \VAR{list}} starting with first element of list matching \VAR{foo}. Return \retval{\NIL} otherwise. + } \IT{(\FU*{SUBSETP} \VAR{list-a} \VAR{list-b} \orGOO{\kwd{:test} \VAR{ function}\\ \kwd{:test-not} \VAR{ function}\\ - \kwd{:key} \VAR{ function}}{\}})} + \kwd{:key} \VAR{ function}}{\}})} + { Return \retval{\T} if \VAR{list-a} is a subset of \VAR{list-b}. + } \end{LIST} @@ -56,33 +70,48 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \begin{LIST}{1cm} - \IT{(\FU*{CONS} \VAR{foo} \VAR{bar})} + \IT{(\FU*{CONS} \VAR{foo} \VAR{bar})} + { Return new cons \retval{(\VAR{foo} \VAR{bar})}. + } - \IT{(\FU*{LIST} \OPn{\VAR{foo}})} Return \retval{list of \VAR{foo}s}. + \IT{(\FU*{LIST} \OPn{\VAR{foo}})} + {Return \retval{list of \VAR{foo}s}. + } - \IT{(\FU*{LIST*} \RP{\VAR{foo}})} Return \retval{list of \VAR{foo}s} + \IT{(\FU*{LIST*} \RP{\VAR{foo}})} + {Return \retval{list of \VAR{foo}s} with last \VAR{foo} becoming cdr of last cons. Return \retval{\VAR{foo}} if only one \VAR{foo} given. + } \IT{(\FU*{MAKE-LIST} \VAR{num} \Op{\kwd{:initial-element} - \VAR{foo}\DF{\NIL}})} Return \retval{list with \VAR{num} elements} + \VAR{foo}\DF{\NIL}})} + {Return \retval{list with \VAR{num} elements} set to \VAR{foo}. + } - \IT{(\FU*{LIST-LENGTH} \VAR{list})} \retval{Length} of \VAR{list}; + \IT{(\FU*{LIST-LENGTH} \VAR{list})} + {\retval{Length} of \VAR{list}; \retval{\NIL} for circular \VAR{list}. + } \IT{(\FU*{CAR} \VAR{ foo})} + { \retval{car of list \VAR{foo}} or \retval{\NIL} if \VAR{foo} is \NIL. \kwd{SETF}able. + } \IT{\arrGOO{(\FU*{CDR} \VAR{ foo})\\ - (\FU*{REST} \VAR{ foo})}{\}}} + (\FU*{REST} \VAR{ foo})}{.}} + { \retval{cdr of list \VAR{foo}} or \retval{\NIL} if \VAR{foo} is \NIL. \kwd{SETF}able. + } \IT{(\Goo{\FU*{FIRST}\XOR\FU*{SECOND}\XOR\FU*{THIRD}\XOR\dots\XOR\FU*{NINTH}\XOR\FU*{TENTH}} \VAR{foo})} + { \index{FOURTH}% \index{FIFTH}% \index{SIXTH}% @@ -90,8 +119,10 @@ \index{EIGHTH}% Return \retval{nth element of list \VAR{foo}} if any, or \retval{\NIL} otherwise. \kwd{SETF}able. + } \IT{(\FU{C}\VAR{X}\kwd{R} \VAR{foo})} + { \index{CAAR} \index{CADR} \index{CDAR} @@ -101,77 +132,113 @@ (\FU{CADR} \VAR{bar}) is equivalent to (\FU{CAR} (\FU{CDR} \VAR{bar})). \kwd{SETF}able. + } - \IT{(\FU*{LAST} \VAR{foo} \Op{\VAR{num}})} + \IT{(\FU*{LAST} \VAR{foo} \Op{\VAR{num}})} + { Return list of \retval{last \VAR{num} conses} of list \VAR{foo}. + } - \IT{(\xorGOO{\FU*{BUTLAST}\\\FU*{NBUTLAST}}{\}} \VAR{foo} \Op{\VAR{num}})} + \IT{(\xorGOO{\FU*{BUTLAST}\\\FU*{NBUTLAST}}{\}} \VAR{foo} + \Op{\VAR{num}})} + { Return \retval{list excluding last \VAR{num} conses} of list \VAR{foo}. + } \IT{(\xorGOO{\FU*{RPLACA}\\ - \FU*{RPLACD}}{\}} \VAR{cons} \VAR{object})} + \FU*{RPLACD}}{\}} \VAR{cons} \VAR{object})} + { Replace car, or cdr, resp., of \retval{\VAR{cons}} with \VAR{object}. + } - \IT{(\FU*{LDIFF} \VAR{list} \VAR{foo})} + \IT{(\FU*{LDIFF} \VAR{list} \VAR{foo})} + { If \VAR{foo} is a tail of \VAR{list}, return \retval{preceding part of \VAR{list}}. Otherwise return \retval{\VAR{list}}. + } - \IT{(\kwd*{NTH} \VAR{n list})} Return \VAR{n}th element (zero-based) of \VAR{list}. + \IT{(\kwd*{NTH} \VAR{n list})} + {Return \VAR{n}th element (zero-based) of \VAR{list}. + } - \IT{(\kwd*{NTHCDR} \VAR{n list})} Return \retval{tail of \VAR{list}} after calling \kwd{cdr} \VAR{n} times. + \IT{(\kwd*{NTHCDR} \VAR{n list})} + {Return \retval{tail of \VAR{list}} after calling \kwd{cdr} \VAR{n} times. + } \IT{(\FU*{ADJOIN} \VAR{foo} \VAR{list} \orGOO{\kwd{:test} \VAR{ function}\\ \kwd{:test-not} \VAR{ function}\\ - \kwd{:key} \VAR{ function}}{\}})} Return \retval{\VAR{list}} if \VAR{foo} is + \kwd{:key} \VAR{ function}}{\}})} + {Return \retval{\VAR{list}} if \VAR{foo} is already member of \VAR{list}. If not, return \retval{(\kwd{CONS} \VAR{foo} \VAR{list})}. + } - \IT{(\FU*{POP} \VAR{place})} + \IT{(\FU*{POP} \VAR{place})} + { Set \VAR{place} to \retval{(\kwd{CDR} \VAR{place})}, return \retval{(\kwd{CAR} \VAR{place})} + } - \IT{(\FU*{PUSH} \VAR{foo} \VAR{place})} Set \VAR{place} to + \IT{(\FU*{PUSH} \VAR{foo} \VAR{place})} + {Set \VAR{place} to \retval{(\kwd{cons} \VAR{foo} \VAR{place})}. + } - \IT{(\FU*{PUSHNEW} \VAR{foo} \VAR{place} )} Set \VAR{place} to + \IT{(\FU*{PUSHNEW} \VAR{foo} \VAR{place} )} + {Set \VAR{place} to \retval{(\kwd{adjoin} \VAR{foo} \VAR{place})}. + } - \IT{\arrGOO{(\FU*{APPEND} \OPn{\VAR{ list}})\\(\FU*{NCONC} \OPn{\VAR{ list}})}{\}}} + \IT{\arrGOO{(\FU*{APPEND} \OPn{\VAR{ list}})\\ + (\FU*{NCONC} + \OPn{\VAR{ list}})}{.}} + { Return \retval{concatenated list}. \VAR{list}s are unmodified/possibly modified, resp. + } \IT{\arrGOO{(\FU*{REVAPPEND} \VAR{ list} \VAR{ foo})\\(\FU*{NRECONC} - \VAR{ list} \VAR{ foo})}{\}}} + \VAR{ list} \VAR{ foo})}{.}} + { Return \retval{concatenated list} after reversing order in \VAR{list}. \VAR{list} is unmodified/possibly modified, resp. + } \IT{(\xorGOO{\FU*{MAPCAR}\\ - \FU*{MAPLIST}}{\}} \VAR{function} \RP{\VAR{list}})} + \FU*{MAPLIST}}{\}} \VAR{function} \RP{\VAR{list}})} + { Return \retval{list of return values} of \VAR{function} successively invoked with corresponding arguments, either cars or cdrs, resp., from each list. + } \IT{(\xorGOO{\FU*{MAPCAN}\\ - \FU*{MAPCON}}{\}} \VAR{function} \RP{\VAR{list}})} + \FU*{MAPCON}}{\}} \VAR{function} \RP{\VAR{list}})} + { Return list of \retval{concatenated return values} of \VAR{function} successively invoked with corresponding arguments, either cars or cdrs, resp., from each list. \VAR{function} should return a list. + } \IT{(\xorGOO{\FU*{MAPC}\\ - \FU*{MAPL}}{\}} \VAR{function} \RP{\VAR{list}})} + \FU*{MAPL}}{\}} \VAR{function} \RP{\VAR{list}})} + { Return \retval{first \VAR{list}} after successively applying \VAR{function} to corresponding arguments, either cars or cdrs, resp., from each list. \VAR{function} should have some side effects. + } \IT{(\FU*{COPY-LIST} \VAR{list})} + { Return \retval{copy} of \VAR{list}. + } \end{LIST} @@ -182,11 +249,15 @@ \label{section:Association Lists} \begin{LIST}{1cm} - \IT{(\FU*{PAIRLIS} \VAR{keys} \VAR{values})} + \IT{(\FU*{PAIRLIS} \VAR{keys} \VAR{values})} + { Make \retval{association list} from lists \VAR{keys} and \VAR{values}. - + } + \IT{(\FU*{ACONS} \VAR{key} \VAR{value} \VAR{a-list})} + { Return \retval{\VAR{a-list}} with a (\VAR{key} . \VAR{value}) pair added. + } \IT{\arrGOO{(\xorGOO{\FU*{ASSOC}\\ \FU*{RASSOC}}{\}}% @@ -200,10 +271,14 @@ \FU*{ASSOC-IF-NOT}\\ \FU*{RASSOC-IF-NOT}}{\}}\VAR{test} \VAR{ a-list }% \Op{\kwd{:key} \VAR{ function}})}{\}}} + { First \retval{cons} whose car, or cdr, resp., satisfies \VAR{test}. + } \IT{(\FU*{COPY-ALIST} \VAR{a-list})} + { Return \retval{copy} of \VAR{a-list}. + } \end{LIST} @@ -215,21 +290,26 @@ \IT{(\FU*{TREE-EQUAL} \VAR{foo} \VAR{bar} \orGOO{\kwd{:test} \VAR{ function}\\ - \kwd{:test-not} \VAR{ function}}{\}})} + \kwd{:test-not} \VAR{ function}}{\}})} + { Return \retval{\T} if trees \VAR{foo} and \VAR{bar} have same shape and \kwd{eql} leaves, return \retval{\NIL} otherwise. + } \IT{(\xorGOO{\FU*{SUBST}\\\FU*{NSUBST}}{\}} \VAR{new} \VAR{old} \VAR{tree} \orGOO{\kwd{:key} \VAR{ function}\\ \kwd{:test} \VAR{ function}\\ - \kwd{:test-not} \VAR{ function}}{\}})} + \kwd{:test-not} \VAR{ function}}{\}})} + { Make \retval{copy of \VAR{tree}} with all subtrees or leaves of \VAR{old} replaced by \VAR{new}. \VAR{tree} is unmodified/possibly modified, resp. + } \IT{(\xorGOO{\FU{SUBST-IF\Op{-NOT}}\\\FU{NSUBST-IF\Op{-NOT}}}{\}} \VAR{new} \VAR{test} \VAR{tree} \Op{\kwd{:key} \VAR{function}})} + { \index{SUBST-IF}% \index{SUBST-IF-NOT}% \index{NSUBST-IF}% @@ -238,18 +318,23 @@ \VAR{tree}} with all subtrees or leaves satisfying test or not satisfying test, resp., replaced by \VAR{new}. \VAR{sequence} is unmodified/possibly modified, resp. + } \IT{(\xorGOO{\FU*{SUBLIS}\\ \FU*{NSUBLIS}}{\}}\VAR{a-list} \VAR{tree}\orGOO{% \kwd{:key} \VAR{ function}\\ \kwd{:test} \VAR{ function}\\ \kwd{:test-not} \VAR{ function}}{\}})} + { Make \retval{copy of \VAR{tree}} with all subtrees or leaves matching a key in \VAR{a-list} replaced by that key's object from \VAR{a-list}. \VAR{sequence} is unmodified/possibly modified, resp. - + } + \IT{(\FU*{COPY-TREE} \VAR{tree})} + { Return \retval{copy of \VAR{tree}}. + } \end{LIST} @@ -266,10 +351,12 @@ \VAR{a} \VAR{b} \orGOO{\kwd{:test} \VAR{ function}\\ \kwd{:test-not} \VAR{ function}\\ - \kwd{:key} \VAR{ function}}{\}})} + \kwd{:key} \VAR{ function}}{\}})} + { Return \retval{$a\cup b$}, \retval{$a\cap b$}, \retval{$a\setminus b$}, or \retval{$a\,\triangle\, b$}, resp., of lists \VAR{a} and \VAR{b}. Work non-destructively/destructively, resp. + } \end{LIST} diff --git a/clqr-control-structure.tex b/clqr-control-structure.tex index 90ab7c6..0c6587b 100644 --- a/clqr-control-structure.tex +++ b/clqr-control-structure.tex @@ -16,34 +16,50 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \begin{LIST}{1cm} - \IT{(\FU*{EQ} \VAR{foo bar})} + \IT{(\FU*{EQ} \VAR{foo bar})} + { \retval{\T} if \VAR{foo} and \VAR{bar} are identical. + } - \IT{(\FU*{EQL} \VAR{foo bar})} + \IT{(\FU*{EQL} \VAR{foo bar})} + { \retval{\T} if \VAR{foo} and \VAR{bar} are identical, or are the same character, or are the same number. + } - \IT{(\FU*{EQUAL} \VAR{foo bar})} + \IT{(\FU*{EQUAL} \VAR{foo bar})} + { \retval{\T} if \VAR{foo} and \VAR{bar} are \FU{EQL}, or are conses with \FU{equal} cars and cdrs, or are strings or bit-vectors with \FU{eql} elements, or are equivalent pathnames. + } - \IT{(\FU*{EQUALP} \VAR{foo bar})} + \IT{(\FU*{EQUALP} \VAR{foo bar})} + { \retval{\T} if \VAR{foo} and \VAR{bar} are \FU{EQUAL}, or if they have corresponding components of the same type which are \kwd{equalp}. + } \IT{(\FU*{NOT} \VAR{bool})} + { Return \retval{\NIL} if \VAR{bool} is \T, return \retval{\T} if \VAR{bool} is \NIL. + } - \IT{(\FU*{CONSTANTP} \VAR{foo} \Op{\VAR{environment}})} + \IT{(\FU*{CONSTANTP} \VAR{foo} \Op{\VAR{environment}})} + { \retval{\T} if \VAR{foo} is a constant form. + } \IT{(\FU*{FUNCTIONP} \VAR{foo})} + { \retval{\T} if \VAR{foo} is of type \kwd{function}. + } \IT{(\FU*{FBOUNDP} \VAR{foo})} + { \retval{\T} if \VAR{foo} is the name of a global function or macro.. + } \end{LIST} @@ -56,69 +72,97 @@ \begin{LIST}{1cm} \IT{(\kwd*{DEFVAR} \VAR{name} \OP{\VAR{value} - \Op{\VAR{documentation}}})} + \Op{\VAR{documentation}}})} + { Unless bound already, assign \VAR{value} to dynamic variable \retval{\VAR{name}}. + } \IT{(\kwd*{DEFPARAMETER} \VAR{name} \VAR{value} - \Op{\VAR{documentation}})} + \Op{\VAR{documentation}})} + { Assign \VAR{value} to dynamic variable \retval{\VAR{name}}. + } \IT{(\kwd*{DEFCONSTANT} \VAR{name} \VAR{value} - \Op{\VAR{documentation}})} + \Op{\VAR{documentation}})} + { Assign \VAR{value} to global constant \retval{\VAR{name}}. + } - \IT{(\FU*{NTH-VALUE} \VAR{n} \VAR{form})} + \IT{(\FU*{NTH-VALUE} \VAR{n} \VAR{form})} + { \retval{\VAR{n}th return value} of \VAR{form}. + } \IT{(\xorGOO{\SF*{SETF}\\\SF*{PSETF}}{\}} \Goos{\VAR{place} - \VAR{value}})} + \VAR{value}})} + { Set \VAR{place}s to \retval{\VAR{value}s}, resp. Work sequentially/in parallel, resp. + } \IT{(\xorGOO{\SF*{SETQ}\\\SF*{PSETQ}}{\}} \Goos{\VAR{symbol} - \VAR{value}})} + \VAR{value}})} + { Set \VAR{symbol}s to \retval{\VAR{value}s}, resp. Work sequentially/in parallel, resp. + } - \IT{(\FU*{SET} \VAR{symbol} \VAR{foo})} + \IT{(\FU*{SET} \VAR{symbol} \VAR{foo})} + { Set \VAR{symbol}'s value cell to \retval{\VAR{foo}}. + } \IT{(\SF*{MULTIPLE-VALUE-SETQ} \VAR{vars} \VAR{form})} + { Set \VAR{vars} to the respective values returned by \VAR{form}. Return \retval{\VAR{form}'s primary value}. + } - \IT{(\SF*{SHIFTF} \RP{\VAR{place}} \VAR{foo})} + \IT{(\SF*{SHIFTF} \RP{\VAR{place}} \VAR{foo})} + { Store \VAR{foo} in rightmost \VAR{place} shifting values of \VAR{place}s left, returning \retval{first \VAR{place}}. + } - \IT{(\SF*{ROTATEF} \OPn{\VAR{place}})} + \IT{(\SF*{ROTATEF} \OPn{\VAR{place}})} + { Rotate values of \VAR{place}s left, old first becoming new last \VAR{place}'s value. Return \retval{\NIL}. + } \IT{(\FU*{MAKUNBOUND} \VAR{symbol})} + { Make \retval{\VAR{symbol}} unbound. + } \label{:property_lists} \IT{\arrGOO{(\FU*{GET} \VAR{ symbol} \VAR{ key } \OP{\VAR{default}\DF{\NIL}})\\ (\FU*{GETF} \VAR{ place} \VAR{ key } - \OP{\VAR{default}\DF{\NIL}})}{\}}} + \OP{\VAR{default}\DF{\NIL}})}{.}} + { \retval{First entry \VAR{key}} from property list stored in \VAR{symbol}/in \VAR{place}, resp., or \retval{\VAR{default}} if there was no \VAR{key}. \kwd{setf}able. + } \IT{(\FU*{GET-PROPERTIES} \VAR{plist} \VAR{key-list})} + { Return \retval{key} and \retvalii{value} of first entry from \VAR{plist} matching a key from \VAR{key-list}, and \retvaliii{tail of \VAR{plist}} starting with \VAR{key}. Return \retval{\NIL}, \retvalii{\NIL}, and \retvaliii{\NIL} if there was no \VAR{key}. + } \IT{\arrGOO{(\FU*{REMPROP} \VAR{ symbol} \VAR{ key})\\ - (\SF*{REMF} \VAR{ place} \VAR{ key})}{\}}} + (\SF*{REMF} \VAR{ place} \VAR{ key})}{.}} + { Remove fist entry \VAR{key} from property list stored in \VAR{symbol}/in \VAR{place}, resp. Return \retval{\T} if \VAR{key} was there, or \retval{\NIL} otherwise. + } \end{LIST} @@ -146,10 +190,12 @@ Below, lambda list (\OPn{\VAR{fu-arg}}) has the form\\ \IT{(\xorGOO{\SF*{DEFUN} \VAR{ foo}\\ \SF*{LAMBDA}}{\}} (\VAR{\OPn{fu-arg}}) \OPn{(\kwd{declare} \OPn{\VAR{decl}})} \Op{\VAR{documentation}} - \OPn{\VAR{form}})} + \OPn{\VAR{form}})} + { Define function with \retval{name \VAR{foo}} or an anonymous function, resp., which applies \VAR{form}s to \VAR{fu-arg}s. + } \IT{(\xorGOO{\SF*{FLET}\\ \SF*{LABELS}}{\}}% (\OPn{(\VAR{foo} @@ -157,62 +203,94 @@ Below, lambda list (\OPn{\VAR{fu-arg}}) has the form\\ \OPn{(\kwd{declare} \OPn{\VAR{local-decl}})}% \Op{\VAR{documentation}} \OPn{\VAR{local-form}})})\OPn{(\kwd{declare} \VAR{decl})} - \OPn{\VAR{form}})} + \OPn{\VAR{form}})} + { Evaluate \VAR{form}s with locally defined functions \OPn{\VAR{foo}}. Only for \SF{LABELS}, \VAR{name}s are visible inside \VAR{local-forms}. Return \retval{values of \VAR{form}s}. + } - \IT{(\SF*{FUNCTION} \VAR{foo})} Return \retval{function named \VAR{foo}}. + \IT{(\SF*{FUNCTION} \VAR{foo})} + {Return \retval{function named \VAR{foo}}. + } \IT{(\FU*{APPLY} \VAR{function} \RP{\VAR{arg}})} + { Return \retval{value of \VAR{function}} called with \VAR{arg}s. Last \VAR{arg} must be a list. + } - \IT{(\FU*{FUNCALL} \VAR{function} \OPn{arg})} + \IT{(\FU*{FUNCALL} \VAR{function} \OPn{arg})} + { Return \retval{value of \VAR{function}} called with \VAR{arg}s. + } - \IT{(\SF*{MULTIPLE-VALUE-CALL} \VAR{foo} \OPn{\VAR{form}})} Call function + \IT{(\SF*{MULTIPLE-VALUE-CALL} \VAR{foo} \OPn{\VAR{form}})} + {Call function \VAR{foo} with values of \VAR{form}s as its arguments. Return \retval{values returned by \VAR{foo}}. + } - \IT{(\FU*{VALUES-LIST} \VAR{list})} + \IT{(\FU*{VALUES-LIST} \VAR{list})} + { Return \retval{elements of \VAR{list}}. + } - \IT{(\FU*{VALUES} \OPn{\VAR{foo}})} + \IT{(\FU*{VALUES} \OPn{\VAR{foo}})} + { Return \retval{\VAR{foo}s} as multiple values. \kwd{setf}able. + } - \IT{(\FU*{MULTIPLE-VALUE-LIST} \OPn{\VAR{form}})} + \IT{(\FU*{MULTIPLE-VALUE-LIST} \OPn{\VAR{form}})} + { Return in a \retval{list} values of \VAR{form}s. + } \IT{(\FU*{COMPLEMENT} \VAR{function})} + { Return \retval{new function} with same arguments and same side effects as \VAR{function}, but with complementary truth value. + } - \IT{(\FU*{CONSTANTLY} \VAR{foo})} + \IT{(\FU*{CONSTANTLY} \VAR{foo})} + { Return \retval{function} returning \VAR{foo}. + } - \IT{(\FU*{IDENTITY} \VAR{foo})} + \IT{(\FU*{IDENTITY} \VAR{foo})} + { Return \retval{\VAR{foo}}. + } \IT{(\FU*{FUNCTION-LAMBDA-EXPRESSION} \VAR{function})} + { If available, return \retval{lambda expression} of \VAR{function}, \retvalii{\NIL} if \VAR{function} was defined in an environment without bindings, and \retvaliii{name} of \VAR{function}. + } - \IT{(\FU*{FDEFINITION} \VAR{foo})} + \IT{(\FU*{FDEFINITION} \VAR{foo})} + { \retval{Definition} of function \VAR{foo}. \kwd{setf}able. + } \IT{(\FU*{FMAKUNBOUND} \VAR{foo})} + { Remove global function or macro definition \retval{\VAR{foo}}. + } \IT{\arrGOO{\CNS*{CALL-ARGUMENTS-LIMIT}\\ - \CNS*{LAMBDA-PARAMETERS-LIMIT}}{\}}} + \CNS*{LAMBDA-PARAMETERS-LIMIT}}{.}} + { Upper bound of the number of function arguments or lambda list parameters, resp.; $\geq50$. + } \IT{\CNS*{MULTIPLE-VALUES-LIMIT}} + { Upper bound of the number of values a function can return; $\geq20$. + } \end{LIST} @@ -256,47 +334,65 @@ or\\ \VAR{foo} (\OPn{\VAR{macro-arg}}) \OPn{(\kwd{declare} \OPn{\VAR{decl}})} \Op{\VAR{documentation}} \OPn{\VAR{form}})} + { Define macro \retval{\VAR{foo}}. + } - \IT{(\SF*{DEFINE-SYMBOL-MACRO} \VAR{name} \VAR{expansion-form})} + \IT{(\SF*{DEFINE-SYMBOL-MACRO} \VAR{name} \VAR{expansion-form})} + { Make \retval{\VAR{name}} a macro call. + } \IT{(\SF*{MACROLET} (\OPn{(\OPn{name} (\OPn{\VAR{macro-arg}}) \OPn{(\kwd{declare} \OPn{\VAR{local-decl}})} \Op{\VAR{documentation}} \OPn{form})}) \OPn{(\kwd{declare} - \OPn{\VAR{decl}})} \OPn{\VAR{body}})} + \OPn{\VAR{decl}})} \OPn{\VAR{body}})} + { Evaluate \retval{\OPn{\VAR{body}}} with \VAR{name}s locally defined as corresponding macros which are invisible to each other. + } \IT{(\SF*{SYMBOL-MACROLET} (\OPn{(\VAR{name} \OPn{\VAR{form}})})\OPn{(\kwd{declare} \OPn{\VAR{decl}})} - \OPn{\VAR{body}})} + \OPn{\VAR{body}})} + { Evaluate \retval{\OPn{\VAR{body}}} with \VAR{name}s locally defined as corresponding symbol-macros. + } \IT{(\SF*{DEFSETF} \VAR{function}\xorGOO{\VAR{update } \Op{\VAR{documentation}}\\ \OPn{\VAR{arg } (\OPn{\VAR{var}}) \OPn{(\kwd{declare} \OPn{\VAR{ - decl}})} \Op{\VAR{documentation}}}}{\}})} + decl}})} \Op{\VAR{documentation}}}}{\}})} + { Specify how to \kwd{setf} a place accessed by \retval{\VAR{function}} if \VAR{function} evaluates all its arguments. - + } + \IT{(\SF*{DEFINE-SETF-EXPANDER} \VAR{function} (\OPn{\VAR{macro-arg}}) \OPn{(\kwd{declare} \OPn{\VAR{decl}})} \Op{\VAR{documentation}} \OPn{\VAR{form}})} + { Specify how to \kwd{setf} a place accessed by \retval{\VAR{function}}. + } \IT{(\SF*{DEFINE-MODIFY-MACRO} \VAR{foo} (\kwd{\&optional} \OPn{\VAR{var}} \kwd{\&rest} \OPn{\VAR{var}}) \VAR{function} - \Op{documentation})} + \Op{documentation})} + { Define macro \retval{\VAR{foo}} able to read and write a place. On invokation, after applying \VAR{function} to place its return value is stored there. + } - \IT{(\FU*{GET-SETF-EXPANSION} \VAR{place} \Op{\VAR{environment}})} + \IT{(\FU*{GET-SETF-EXPANSION} \VAR{place} \Op{\VAR{environment}})} + { Return five values describing how to \kwd{setf} place. + } - \IT{\CNS*{LAMBDA-LIST-KEYWORDS}} List of macro lambda list keywords. + \IT{\CNS*{LAMBDA-LIST-KEYWORDS}} + {List of macro lambda list keywords. + } \end{LIST} @@ -306,46 +402,63 @@ or\\ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \begin{LIST}{1cm} - \IT{(\SF*{IF} \VAR{test} \VAR{then} \Op{\VAR{else}})} Evaluate and return + \IT{(\SF*{IF} \VAR{test} \VAR{then} \Op{\VAR{else}})} + {Evaluate and return \retval{\VAR{then}} if \VAR{test} returns \T, evaluate and return \retval{\VAR{else}} otherwise. + } - \IT{(\SF*{COND} \OPn{(\VAR{test} \OPn{\VAR{then}})})} + \IT{(\SF*{COND} \OPn{(\VAR{test} \OPn{\VAR{then}})})} + { Evaluate and return the \retval{\VAR{then}s} whose \VAR{test} returns \T, return \retval{\NIL} if all \VAR{test}s return \NIL. + } - \IT{(\xorGOO{\SF*{WHEN}\\\SF*{UNLESS}}{\}} \VAR{test} \OPn{\VAR{foo}})} + \IT{(\xorGOO{\SF*{WHEN}\\\SF*{UNLESS}}{\}} \VAR{test} + \OPn{\VAR{foo}})} + { Evaluate \VAR{foo}s and return \retval{values of last \VAR{foo}} if \VAR{test} returns \T\ or \NIL, resp. Return \retval{\NIL} otherwise. + } \IT{(\SF*{CASE} \VAR{object} \OPn{(\RP{\VAR{key}}\OPn{\VAR{foo}})} \Op{(\Goo{\T\XOR\kwd*{OTHERWISE}} \OPn{\VAR{bar}})\DF{\NIL}})} + { Evaluate first \VAR{foo}s whose unevaluated \VAR{key} is \kwd{eql} evaluated \VAR{object} and return \retval{their values}. Return \retval{values of \VAR{bar}s} if no \LIT{key} matches. + } \IT{(\Goo{\SF*{CCASE}\XOR\SF*{ECASE}} \VAR{object} - \OPn{(\RP{\VAR{key}}\OPn{\VAR{foo}})})} + \OPn{(\RP{\VAR{key}}\OPn{\VAR{foo}})})} + { Evaluate first \VAR{foo}s whose unevaluated \VAR{key} is \kwd{eql} evaluated \VAR{object}. Return \retval{value of last evaluated \VAR{foo}}. Signal correctible error/non-correctible error, resp., if no \VAR{key} matches and return \retval{\NIL} then. + } - \IT{(\SF*{AND} \OPn{\VAR{form}})} + \IT{(\SF*{AND} \OPn{\VAR{form}})} + { Evaluate \VAR{form}s from left to right. Immediately return \retval{\NIL} if one \VAR{form}'s value is \NIL. Return \retval{values of last \VAR{form}} otherwise. Without any \VAR{form}, return \retval{\NIL}. + } - \IT{(\SF*{OR} \OPn{\VAR{form}})} + \IT{(\SF*{OR} \OPn{\VAR{form}})} + { Evaluate \VAR{form}s from left to right. Immediately return \retval{primary value} of first non-\NIL-evaluating form, or \retval{all values} if last \VAR{form} is reached. Return \retval{\NIL} if no \VAR{form} returns \T. + } - \IT{(\kwd*{PROGN} \OPn{\VAR{form}})} Sequence \VAR{form}s. Return + \IT{(\kwd*{PROGN} \OPn{\VAR{form}})} + {Sequence \VAR{form}s. Return \retval{value of last \VAR{form}}. + } \IT{(\xorGOO{\SF*{PROG}\\ \SF*{PROG*}}{\}} @@ -354,29 +467,39 @@ or\\ (\VAR{var } \Op{ \VAR{value}})}{\}^{\!\!*}}) \OPn{(\kwd{declare} \OPn{\VAR{decl}})} \xorGOO{\VAR{tag}\\\VAR{form}}{\}^{\!\!*}})} + { Evaluate \kwd{TAGBODY}-like body with locally bound \VAR{var}s. Return \retval{\NIL} or explicitly \retval{\kwd{return}ed value}. - + } + \IT{\arrGOO{% (\SF*{MULTIPLE-VALUE-PROG1} \VAR{ form-r} \OPn{\VAR{ form}})\\ (\SF*{PROG1} \VAR{ form-r} \OPn{\VAR{ form}})\\ - (\SF*{PROG2} \VAR{ form-a} \VAR{ form-r} \OPn{\VAR{ form}})}{\}}} + (\SF*{PROG2} \VAR{ form-a} \VAR{ form-r} \OPn{\VAR{ form}})}{.}} + { Evaluate all forms in order. Return \retval{values/1st value of \VAR{form-r}}. + } \IT{(\SF*{PROGV} \VAR{symbols} \VAR{values} \OPn{\VAR{form}})} + { Evaluate \VAR{form}s with \VAR{symbols} dynamically bound to \VAR{values} or \NIL. Return \retval{values returned by \VAR{form}s}. + } \IT{(\SF*{DESTRUCTURING-BIND} \VAR{foo} \VAR{bar} \OPn{(\kwd{declare} - \OPn{\VAR{decl}})} \OPn{\VAR{form}})} + \OPn{\VAR{decl}})} \OPn{\VAR{form}})} + { Evaluate \VAR{form}s, and return \retval{values of last \VAR{form}}, with variables from tree \VAR{foo} bound to corresponding elements of tree \VAR{bar}. + } \IT{(\kwd*{MULTIPLE-VALUE-BIND} (\OPn{\VAR{var}}) \VAR{values-form} - \OPn{(\kwd{declare} \OPn{\VAR{decl}})} \OPn{\VAR{body-form}})} Evaluate + \OPn{(\kwd{declare} \OPn{\VAR{decl}})} \OPn{\VAR{body-form}})} + {Evaluate body with \VAR{var}s bound to the return values of \VAR{values-form}. Return \retval{values returned by \VAR{body-form}s}. + } \IT{(\xorGOO{\SF*{LET}\\ \SF*{LET*}}{\}}(% @@ -384,45 +507,67 @@ or\\ (\VAR{name }\Op{\VAR{value}})}{\}^{\!\!*}}) \OPn{(\kwd{declare} \OPn{\VAR{decl}})} \OPn{\VAR{form}})} + { Evaluate \VAR{form}s with \VAR{name}s bound to \VAR{value}s or \NIL. Return \retval{values of \VAR{form}s}. In \SF{LET*}, \VAR{value}s can refer to previous \VAR{name}s. + } \IT{(\SF*{LOCALLY} \OPn{(\kwd{declare} \OPn{\VAR{decl}})} \OPn{\VAR{form}})} + { Evaluate \VAR{form}s with declarations \VAR{decl} in effect. Return \retval{values of \VAR{form}s}. + } - \IT{(\SF*{RETURN-FROM} \VAR{foo} \Op{\VAR{result}\DF{\NIL}})} + \IT{(\SF*{RETURN-FROM} \VAR{foo} \Op{\VAR{result}\DF{\NIL}})} + { Have nearest enclosing \kwd{block} \VAR{foo} return with \VAR{result}. + } - \IT{(\SF*{RETURN} \Op{\VAR{result}\DF{\NIL}})} + \IT{(\SF*{RETURN} \Op{\VAR{result}\DF{\NIL}})} + { Have nearest enclosing block \NIL\ return with \retval{\VAR{result}}. + } - \IT{(\SF*{BLOCK} \VAR{name} \OPn{\VAR{form}})} Evaluate \VAR{form}s returning + \IT{(\SF*{BLOCK} \VAR{name} \OPn{\VAR{form}})} + {Evaluate \VAR{form}s returning \retval{values of last \VAR{form}} unless interrupted by \SF{RETURN-FROM}. + } - \IT{(\SF*{TAGBODY} \Goos{\VAR{tag}\XOR\VAR{form}})} + \IT{(\SF*{TAGBODY} \Goos{\VAR{tag}\XOR\VAR{form}})} + { Evaluate \VAR{form}s. \VAR{tag}s (symbols or integers) are targets for \SF{GO}. Return \retval{\NIL}. + } - \IT{(\SF*{GO} \VAR{tag})} Jump within a \SF{tagbody} to nearest + \IT{(\SF*{GO} \VAR{tag})} + {Jump within a \SF{tagbody} to nearest lexically enclosing \kwd{eql} \VAR{tag}. + } - \IT{(\SF*{CATCH} \VAR{tag} \OPn{\VAR{form}})} Evaluate \VAR{form}s returning + \IT{(\SF*{CATCH} \VAR{tag} \OPn{\VAR{form}})} + {Evaluate \VAR{form}s returning \retval{value of last \VAR{form}} unless interrupted by \SF{THROW}. + } - \IT{(\SF*{THROW} \VAR{tag form})} Have the nearest dynamically + \IT{(\SF*{THROW} \VAR{tag form})} + {Have the nearest dynamically enclosing \SF{CATCH} with a tag \kwd{eq} \VAR{tag} return with the value of \VAR{form}. + } \IT{(\FU*{BREAK} \Op{\VAR{control} \OPn{arg}})} + { Jump into debugger, return \retval{\NIL}. See p.\ \pageref{section:Format}, \kwd{format}, for \VAR{control} and \VAR{arg}s. + } - \IT{(\FU*{SLEEP} \VAR{n})} Wait \VAR{n} seconds, return \retval{\NIL}. + \IT{(\FU*{SLEEP} \VAR{n})} + {Wait \VAR{n} seconds, return \retval{\NIL}. + } \end{LIST} @@ -441,23 +586,31 @@ or\\ (\VAR{stop} \OPn{\VAR{result}}) \OPn{(\kwd{declare} \OPn{\VAR{decl}})} \xorGOO{\VAR{tag}\\\VAR{form}}{\}^{\!\!*}})} + { Evaluate \SF{TAGBODY}-like body with \VAR{var}s successively bound according to the values of the corresponding \VAR{start} and \VAR{step} forms. \VAR{var}s are bound in parallel/sequentially, resp. Stop iteration when \VAR{stop} is \T. Return \retval{value of last \VAR{result}}. + } \IT{(\SF*{DOTIMES} (\VAR{var} \VAR{integer} \Op{\VAR{result}}) - \OPn{(\kwd{declare} \OPn{\VAR{decl}})} \Goos{\VAR{tag}\XOR\VAR{form}})} + \OPn{(\kwd{declare} \OPn{\VAR{decl}})} + \Goos{\VAR{tag}\XOR\VAR{form}})} + { Evaluate \SF{TAGBODY}-like body with \VAR{var} successively bound to integers from 0 to $\mbox{\VAR{integer}} - 1$. Upon evaluation of \retval{\VAR{result}}, \VAR{var} is \NIL. + } \IT{(\SF*{DOLIST}(\VAR{var} \VAR{list} \Op{\VAR{result}}) - \OPn{(\kwd{declare} \OPn{\VAR{decl}})} \Goos{\VAR{tag}\XOR\VAR{form}})} + \OPn{(\kwd{declare} \OPn{\VAR{decl}})} + \Goos{\VAR{tag}\XOR\VAR{form}})} + { Evaluate \SF{TAGBODY}-like body with \VAR{var} successively bound to the elements of \VAR{list}. Upon evaluation of \retval{\VAR{result}}, \VAR{var} is \NIL. + } \end{LIST} @@ -725,124 +878,190 @@ or\\ \begin{LIST}{1cm} - \IT{(\SF*{LOOP} \OPn{\VAR{form}})} + \IT{(\SF*{LOOP} \OPn{\VAR{form}})} + { Simple Loop. If \VAR{form}s do not include any keywords of the Loop Facility, evaluate them forever. + } - \IT{(\SF*{LOOP} \OPn{\VAR{form}})} + \IT{(\SF*{LOOP} \OPn{\VAR{form}})} + { Loop Facility. If there are loop facility keywords in \VAR{form}s see below and p.\ \pageref{loop-overview}. + } \begin{LIST}{.5cm} \IT{\LKWD*{named} \VAR{n}} + { Give implicit \kwd{block} of loop a name. + } \IT{\LKWD*{with} \VAR{var} \LKWD*{=} \VAR{foo} \Op{\VAR{type}} \Goo{\LKWD*{and} \VAR{var-n} \Op{\VAR{type}} \LKWD*{=} \VAR{bar}}} + { Initialize local variables in parallel. + } \IT{\Goo{\LKWD*{initially}\XOR\LKWD*{finally}} \RP{\VAR{form}}} + { Evaluate \VAR{form}s before begin, or after end, resp., of iterations. + } \IT{\Goo{\LKWD*{for}\XOR\LKWD*{as}} \VAR{var} \VAR{type}} + { Begin of iteration control clause. + } \begin{LIST}{.5cm} - \IT{\Goo{\LKWD*{upfrom}\XOR\LKWD*{from}\XOR\LKWD*{downfrom}} \VAR{start}} + \IT{\Goo{\LKWD*{upfrom}\XOR\LKWD*{from}\XOR\LKWD*{downfrom}} + \VAR{start}} + { Start stepping with \VAR{start} + } - \IT{\Goo{\LKWD*{upto}\XOR\LKWD*{downto}\XOR\LKWD*{to}\XOR\LKWD*{below}\XOR\LKWD*{above}} \VAR{form}} + \IT{\Goo{\LKWD*{upto}\XOR\LKWD*{downto}\XOR\LKWD*{to}\XOR\LKWD*{below}\XOR\LKWD*{above}} + \VAR{form}} + { Specify \VAR{form} as the end value for stepping. + } \IT{\Goo{\LKWD*{in}\XOR\LKWD*{on}} \VAR{list}} + { Bind \VAR{var} to successive elements/tails, resp., of \VAR{list}. + } \IT{\LKWD*{by} \VAR{step}\DF{1}} + { Specify the (positive) decrement or increment. + } - \IT{\LKWD*{=} \VAR{foo} \Op{\LKWD*{then} \VAR{bar}\DF{\VAR{foo}}}} + \IT{\LKWD*{=} \VAR{foo} \Op{\LKWD*{then} + \VAR{bar}\DF{\VAR{foo}}}} + { Bind \VAR{var} in the first iteration to \VAR{foo} and later to \VAR{bar}. + } \IT{\LKWD*{across} \VAR{vector}} + { Bind \VAR{var} to successive elements of \VAR{vector}. + } \IT{\LKWD*{being} \Goo{\LKWD*{the}\XOR\LKWD*{each}}} + { Iterate over a hash table or a package. + } \begin{LIST}{.5cm} \IT{\Goo{\LKWD*{hash-key}\XOR\LKWD*{hash-keys}}\Goo{\LKWD*{of}\XOR\LKWD*{in}} \VAR{hash-table} \Op{\LKWD*{using} (\LKWD*{hash-value} \VAR{value})}} + { Bind \VAR{var} successively to the keys of \VAR{hash-table}; bind corresponding values to \VAR{value}. + } \IT{\Goo{\LKWD*{hash-value}\XOR\LKWD*{hash-values}}\Goo{\LKWD*{of}\XOR\LKWD*{in}} \VAR{hash-table} \Op{\LKWD*{using} (\LKWD*{hash-key} \VAR{key})}} + { Bind \VAR{var} successively to the values of \VAR{hash-table}; bind corresponding keys to \VAR{key}. + } \IT{\Goo{\LKWD*{symbol}\XOR\LKWD*{symbols}\XOR\LKWD*{present-symbol}\XOR\LKWD*{present-symbols}\XOR\LKWD*{external-symbol}\XOR\LKWD*{external-symbols}}\Op{\Goo{\LKWD*{of}\XOR\LKWD*{in}} - \VAR{package}}} + \VAR{package}}} + { Bind \VAR{var} successively to the symbols, or the present symbols, or the external symbols, resp., of \VAR{package}. + } \end{LIST} \end{LIST} \IT{\LKWD*{and} \VAR{var}} + { Begin of another iteration control clause with variables initialized and stepped in parallel. + } \IT{\Goo{\LKWD*{do}\XOR\LKWD*{doing}} \RP{\VAR{form}}} + { Evaluate \VAR{form}s in every iteration. - + } + \IT{\LKWD*{return} \Goo{\VAR{form}\XOR\LKWD*{it}}} + { Return immediately with return value \VAR{form}. - + } + \IT{\Goo{\LKWD*{collect}\XOR\LKWD*{collecting}}\Goo{\VAR{form}\XOR\LKWD*{it}}\Op{\LKWD*{into} \VAR{list}}} + { Collect values of \VAR{form} into \VAR{list}. If no \VAR{list} is given, collect into an anonymous list which is returned after termination. + } - \IT{\Goo{\LKWD*{append}\XOR\LKWD*{appending}\XOR\LKWD*{nconc}\XOR\LKWD*{nconcing}}\Goo{\VAR{form}\XOR\LKWD*{it}}\Op{\LKWD*{into} \VAR{list}}} + \IT{\Goo{\LKWD*{append}\XOR\LKWD*{appending}\XOR\LKWD*{nconc}\XOR\LKWD*{nconcing}}\Goo{\VAR{form}\XOR\LKWD*{it}}\Op{\LKWD*{into} + \VAR{list}}} + { Concatenate values of \VAR{form}, which must be lists, into \VAR{list} by the means of \FU{append} or \FU{nconc}, resp. If no \VAR{list} is given, collect into an anonymous list which is returned after termination. + } - \IT{\Goo{\LKWD*{count}\XOR\LKWD*{counting}}\Goo{\VAR{form}\XOR\LKWD*{it}}\Op{\LKWD*{into} \VAR{n}}} + \IT{\Goo{\LKWD*{count}\XOR\LKWD*{counting}}\Goo{\VAR{form}\XOR\LKWD*{it}}\Op{\LKWD*{into} + \VAR{n}}} + { Count the number of times \VAR{form} returns \T. - + } + \IT{\Goo{\LKWD*{sum}\XOR\LKWD*{summing}}\Goo{\VAR{form}\XOR\LKWD*{it}}\Op{\LKWD*{into} \VAR{sum}}} + { Calculate the sum of the values of \VAR{form}. - + } + \IT{\Goo{\LKWD*{maximize}\XOR\LKWD*{maximizing}\XOR \LKWD*{minimize}\XOR \LKWD*{minimizing}}\Goo{\VAR{form}\XOR\LKWD*{it}}\Op{\LKWD*{into} \VAR{max-min}}} + { Determine the maximum or minimum, resp., of all values of \VAR{form}. - + } + \IT{\Goo{\LKWD*{if}\XOR\LKWD*{when}\XOR\LKWD*{unless}}\VAR{ test} \VAR{form-i} \Goos{\LKWD*{and} \VAR{form-j}}\Op{\LKWD*{else} \VAR{form-k} \Goos{\LKWD*{and} \VAR{form-l}}} \Op{\LKWD*{end}}} + { If \VAR{test} returns \T, \T, or \NIL, resp., evaluate \VAR{form-i} and \VAR{form-j}s; otherwise, evaluate \VAR{form-k} and \VAR{form-l}s. Inside \VAR{form-i} and \VAR{form-k}, the value of \VAR{test} is accessible by \LKWD*{it}. - + } + \IT{\LKWD*{repeat} \VAR{num}} + { Terminate \SF{loop} after \VAR{num} times; \VAR{num} is evaluated once. + } \IT{\Goo{\LKWD*{while}\XOR\LKWD*{until}} \VAR{test}} + { Continue iteriation until \VAR{test} returns \NIL, or \T, resp. + } \IT{\Goo{\LKWD*{always}\XOR\LKWD{never}} \VAR{test}} + { Terminate \SF{loop} returning \NIL\ and skipping any \LKWD*{finally} parts as soon as \VAR{test} is \NIL, or \T, resp. Otherwise continue \SF{loop} with its default return value set to \T. + } \IT{\LKWD*{thereis} \VAR{test}} + { Terminate \SF{loop} when \VAR{test} is \T\ and return value of \VAR{form}, skipping any \LKWD*{finally} parts. Otherwise continue \SF{loop} with its default return value set to \T. + } \IT{\LKWD*{loop-finish}} + { Terminate \SF{loop} immediately; skip any \LKWD*{finally} parts + } \end{LIST} \end{LIST} + diff --git a/clqr-environment.tex b/clqr-environment.tex index 23cad0e..a6b4524 100644 --- a/clqr-environment.tex +++ b/clqr-environment.tex @@ -13,49 +13,69 @@ \begin{LIST}{1cm} \IT{\arrGOO{(\FU*{GET-INTERNAL-REAL-TIME})\\ - (\FU*{GET-INTERNAL-RUN-TIME})}{\}}} + (\FU*{GET-INTERNAL-RUN-TIME})}{.}} + { \retval{Current time}, or \retval{computing time}, resp., in clock ticks. + } \IT{\CNS*{INTERNAL-TIME-UNITS-PER-SECOND}} + { Number of clock ticks per second. + } \IT{\arrGOO{(\FU*{DECODE-UNIVERSAL-TIME} \VAR{ universal-time } \Op{\VAR{time-zone}})\\ - (\FU*{GET-DECODED-TIME})}{\}}} + (\FU*{GET-DECODED-TIME})}{.}} + { Return \retval{second}, \retvalii{minute}, \retvaliii{hour}, \retval{date}, \retval{month}, \retval{year}, \retval{day}, \retval{daylight-p}, and \retval{zone}. + } \IT{\arrGOO{(\FU*{ENCODE-UNIVERSAL-TIME} \VAR{ sec} \VAR{ min} \VAR{ hour} \VAR{ day} \VAR{ month} \VAR{ year } \Op{\VAR{zone}})\\ (\FU*{GET-UNIVERSAL-TIME})}{.}} + { \retval{Seconds from 1900-01-01, 00:00}. + } - \IT{(\FU*{ROOM} \Op{\Goo{\NIL\XOR\kwd{:default}\XOR\T}})} + \IT{(\FU*{ROOM} \Op{\Goo{\NIL\XOR\kwd{:default}\XOR\T}})} + { Print information about internal storage management. + } \IT{\V*{*features*}} + { List of implementation-dependent features. + } \IT{\arrGOO{(\FU*{SHORT-SITE-NAME})\\ - (\FU*{LONG-SITE-NAME})}{\}}} + (\FU*{LONG-SITE-NAME})}{.}} + { \retval{String} representing physical location of computer. + } \IT{\arrGOO{(\FU*{LISP-IMPLEMENTATION-TYPE})\\ - (\FU*{LISP-IMPLEMENTATION-VERSION})}{\}}} + (\FU*{LISP-IMPLEMENTATION-VERSION})}{.}} + { \retval{Name} or \retval{version}, resp., of implementation. + } \IT{\arrGOO{(\FU*{SOFTWARE-TYPE})\\ - (\FU*{SOFTWARE-VERSION})}{\}}} + (\FU*{SOFTWARE-VERSION})}{.}} + { \retval{Name} or \retval{version}, resp., of host system. + } \IT{\arrGOO{(\FU*{MACHINE-TYPE})\\ (\FU*{MACHINE-VERSION})\\ - (\FU*{MACHINE-INSTANCE})}{\}}} + (\FU*{MACHINE-INSTANCE})}{.}} + { \retval{Type}, \retval{version}, or \retval{name}, resp., of hardware. + } \end{LIST} diff --git a/clqr-hash-tables.tex b/clqr-hash-tables.tex index 96c4c85..aa47c3d 100644 --- a/clqr-hash-tables.tex +++ b/clqr-hash-tables.tex @@ -18,49 +18,69 @@ pp.\ \pageref{section:Association Lists} and \pageref{:property_lists}. \begin{LIST}{1cm} \IT{(\FU*{HASH-TABLE-P} \VAR{foo})} + { Return \retval{\T} if \VAR{foo} is of type \kwd{hash-table}. + } \IT{(\FU*{MAKE-HASH-TABLE} \orGOO{\kwd{:test}\Goo{\kwd{eq}\XOR \kwd{eql}\XOR \kwd{equal}}\DF{\kwd{eql}}\\ \kwd{:size} \VAR{ size}\\ \kwd{:rehash-size} \VAR{ rehash-size}\\ - \kwd{:rehash-threshold} \VAR{ rehash-threshold}}{\}})} + \kwd{:rehash-threshold} \VAR{ rehash-threshold}}{\}})} + { Make a \retval{hash table}. + } - \IT{(\FU*{HASH-TABLE-TEST} \VAR{hash-table})} + \IT{(\FU*{HASH-TABLE-TEST} \VAR{hash-table})} + { \retval{Test function} used in \VAR{hash-table}. + } \IT{(\FU*{GETHASH} \VAR{key} \VAR{hash-table} \Op{\VAR{default}})} + { Return \retval{object} with key \VAR{key} if any or \retval{\VAR{default}} otherwise; and \retvalii{\T} if found, \retvalii{\NIL} otherwise. \kwd{setf}able. + } - \IT{(\FU*{HASH-TABLE-COUNT} \VAR{hash-table})} + \IT{(\FU*{HASH-TABLE-COUNT} \VAR{hash-table})} + { \retval{Number of entries} in \VAR{hash-table}. + } - \IT{(\FU*{REMHASH} \VAR{key} \VAR{hash-table})} + \IT{(\FU*{REMHASH} \VAR{key} \VAR{hash-table})} + { Remove from \VAR{hash-table} entry with \VAR{key} and return \retval{\T} if it existed. Return \retval{\NIL} otherwise. + } - \IT{(\FU*{CLRHASH} \VAR{hash-table})} + \IT{(\FU*{CLRHASH} \VAR{hash-table})} + { Empty \retval{\VAR{hash-table}}. + } - \IT{(\FU*{MAPHASH} \VAR{function} \VAR{hash-table})} + \IT{(\FU*{MAPHASH} \VAR{function} \VAR{hash-table})} + { Iterate over \VAR{hash-table} calling \VAR{function} on \VAR{key} and \VAR{value}. Return \retval{\NIL}. - + } + \IT{(\SF*{WITH-HASH-TABLE-ITERATOR} \VAR{name} \VAR{hash-table} \OPn{(\kwd{declare} \OPn{\VAR{decl}})} \OPn{\VAR{form}})} + { Return \retval{values of \VAR{form}s}. In the body, invocations of (\VAR{name}) return: \T\ if an entry is returned; its key; its value. + } \IT{\arrGOO{(\FU*{HASH-TABLE-SIZE} \VAR{ hash-table})\\ (\FU*{HASH-TABLE-REHASH-SIZE} \VAR{ hash-table})\\ - (\FU*{HASH-TABLE-REHASH-THRESHOLD} \VAR{ hash-table})}{\}}} + (\FU*{HASH-TABLE-REHASH-THRESHOLD} \VAR{ hash-table})}{.}} + { Current \retval{size}, \retval{rehash-size}, or \retval{rehash-threshold}, resp., as used in \FU{make-hash-table}. + } \IT{(\FU*{SXHASH} \VAR{foo})} \retval{Hash code} of \VAR{foo}. diff --git a/clqr-input-output.tex b/clqr-input-output.tex index 9d9aeeb..2e08308 100644 --- a/clqr-input-output.tex +++ b/clqr-input-output.tex @@ -11,24 +11,31 @@ \IT{\arrGOO{(\FU*{STREAMP} \VAR{ foo})\\ (\FU*{PATHNAMEP} \VAR{ foo})\\ (\FU*{READTABLEP} \VAR{ foo})}{\}}} - Return \retval{\T} if \VAR{foo} is of type \kwd{stream}, - \kwd{pathname}, or \kwd{readtable}, resp. + { + Return \retval{\T} if \VAR{foo} is of indicated type. + } \IT{\arrGOO{(\FU*{INPUT-STREAM-P} \VAR{ stream})\\ (\FU*{OUTPUT-STREAM-P} \VAR{ stream})\\ (\FU*{INTERACTIVE-STREAM-P} \VAR{ stream})\\ - (\FU*{OPEN-STREAM-P} \VAR{ stream})}{\}}} + (\FU*{OPEN-STREAM-P} \VAR{ stream})}{.}} + { Return \retval{\T} if \VAR{stream} is for input, for output, interactive, or open, resp. + } \IT{(\FU*{PATHNAME-MATCH-P} \VAR{path} \VAR{wildcard})} + { \retval{\T} if \VAR{path} matches \VAR{wildcard}. + } \IT{(\FU*{WILD-PATHNAME-P} \VAR{path} \OP{\Goo{\kwd{:host}\XOR\kwd{:device}\XOR \kwd{:directory}\XOR\kwd{:name}\XOR\kwd{:type} \XOR\kwd{:version}\XOR\NIL}})} + { Return \retval{\T} if indicated component in \VAR{path} is wildcard. + } \end{LIST} @@ -41,120 +48,166 @@ \IT{(\xorGOO{\FU*{Y-OR-N-P}\\ \FU*{YES-OR-NO-P}}{\}} \OP{\VAR{control} \Op{\VAR{args}}})} + { Ask user a question and return \retval{\T} or \retval{\NIL} depending on their answer. See p.\ \pageref{section:Format}, \kwd{format}, for \VAR{control} and \VAR{args}. + } \IT{(\SF*{WITH-STANDARD-IO-SYNTAX} \OPn{\VAR{form}})} + { Evaluate \VAR{form}s with standard behaviour of reader and printer. Return \retval{values of \VAR{form}s}. + } \IT{(\xorGOO{\FU*{READ}\\ \FU*{READ-PRESERVING-WHITESPACE}}{\}} \OP{\VAR{stream}\DF{\T} \OP{\VAR{eof-err}\DF{\T} - \Op{\VAR{eof-val}\DF{\NIL} \Op{\VAR{recursive}\DF{\NIL}}}}})} + \Op{\VAR{eof-val}\DF{\NIL} \Op{\VAR{recursive}\DF{\NIL}}}}})} + { Read printed representation of \retval{object}. + } \IT{(\FU*{READ-FROM-STRING} \VAR{string}\OP{\VAR{eof-error}\DF{\T} \Op{\VAR{eof-val}\DF{\NIL}}}\orGOO{% \kwd{:start}\kwd{:start}\VAR{ start}\DF{0}\\ \kwd{:end}\VAR{ end}\DF{\NIL}\\ \kwd{:preserve-whitespace}\VAR{ bool}\DF{\NIL}}{\}})} + { Return \retval{object} read from string and \retvalii{position} of next character. + } \IT{(\FU*{READ-DELIMITED-LIST} \VAR{char} \OP{\VAR{stream}\DF{\kwd{*standard-input*}} \Op{\VAR{recursive}\DF{\NIL}}})} + { Continue reading until encountering \VAR{char}. Return \retval{list} of objects read. + } \IT{(\FU*{READ-CHAR} \OP{\VAR{stream}\DF{\T} \OP{\VAR{eof-err}\DF{\T} \Op{\VAR{eof-val}\DF{\NIL} - \Op{\VAR{recursive}\DF{\NIL}}}}})} + \Op{\VAR{recursive}\DF{\NIL}}}}})} + { Return \retval{next character} from \VAR{stream}. + } \IT{(\FU*{READ-CHAR-NO-HANG} \OP{\VAR{stream}\DF{\kwd{*standard-input*}} \OP{\VAR{eof-error}\DF{\T} \Op{\VAR{eof-val}\DF{\NIL} - \Op{\VAR{recursive}\DF{\NIL}}}}})} + \Op{\VAR{recursive}\DF{\NIL}}}}})} + { \retval{Next character} from \VAR{stream} or \retval{\NIL} if none is available. + } \IT{(\FU*{PEEK-CHAR} \OP{\VAR{mode}\DF{\NIL}\OP{\VAR{stream}\DF{\kwd{*standard-input*}} \OP{\VAR{eof-error}\DF{\T} \Op{\VAR{eof-val}\DF{\NIL} \Op{\VAR{recursive}\DF{\NIL}}}}}})} + { Next, or, if \VAR{mode} is \T, next non-whitespace \retval{character} from stream without removing it there. + } \IT{(\FU*{UNREAD-CHAR} \VAR{character} - \Op{\VAR{stream}\DF{\kwd{*standard-input*}}})} + \Op{\VAR{stream}\DF{\kwd{*standard-input*}}})} + { Put last read \VAR{character} back into \VAR{stream}, return \retval{\NIL}. + } \IT{(\FU*{READ-BYTE} \VAR{stream} \OP{\VAR{eof-err}\DF{\T} - \Op{\VAR{eof-val}\DF{\NIL}}})} + \Op{\VAR{eof-val}\DF{\NIL}}})} + { Return \retval{next byte} from binary \VAR{stream}. + } \IT{(\FU*{READ-LINE} \OP{\VAR{stream}\DF{\T} \OP{\VAR{eof-err}\DF{\T} \Op{\VAR{eof-val}\DF{\NIL} - \Op{\VAR{recursive}\DF{\NIL}}}}})} + \Op{\VAR{recursive}\DF{\NIL}}}}})} + { Return a \retval{line of text} from \VAR{stream}. Secondary value is \retval{\T} if line was ended by end of file. + } \IT{(\FU*{READ-SEQUENCE} \VAR{sequence} \VAR{stream} \OP{\kwd{:start} \VAR{start}\DF{0}}\Op{\kwd{:end} - \VAR{end}\DF{\NIL}})} + \VAR{end}\DF{\NIL}})} + { Replace elements of \VAR{sequence} between \VAR{start} and \VAR{end} with \VAR{stream}. Return index of \VAR{sequence}'s unmodified element. + } \IT{(\FU*{READTABLE-CASE} \VAR{readtable})} + { \retval{Case sensitivity attribute} of \VAR{readtable}. \kwd{setf}able. + } \IT{(\FU*{COPY-READTABLE} \VAR{from-readtable}\DF{\kwd{*readtable*}} \VAR{to}\DF{\NIL})} + { Return \retval{Copy of \VAR{from-readtable}}. + } \IT{(\FU*{SET-SYNTAX-FROM-CHAR} \VAR{to-char} \VAR{from-char} \OP{\VAR{to-readtable}\DF{\kwd{*readtable*}} \Op{\VAR{from-readtable}\DF{standard readtable}}})} + { Copy syntax of \VAR{from-char} to \VAR{to-readtable}. Return \retval{\T}. + } \IT{\V*{*readtable*}} + { Current readtable. + } - \IT{\V*{*read-base*}\DF{10}} + \IT{\V*{*read-base*}\DF{10}} + { Radix for reading \kwd{integer}s and \kwd{ratio}s. + } \IT{\V*{*read-default-float-format*}\DF{\kwd{single-float}}} + { Floating point format to use when not indicated in the number read. + } \IT{(\FU*{SET-MACRO-CHARACTER} \VAR{char} \VAR{function} \OP{\VAR{non-term-p}\DF{\NIL} - \Op{\VAR{rt}\DF{\kwd{*readtable*}}}})} + \Op{\VAR{rt}\DF{\kwd{*readtable*}}}})} + { Make \VAR{char} a macro character associated with \VAR{function}. Return \retval{\T}. + } \IT{(\FU*{GET-MACRO-CHARACTER} \VAR{char} \Op{\VAR{rt}\DF{\kwd{*readtable*}}})} + { \retval{Reader macro function} associated with \VAR{char}, and \retvalii{\T} if \VAR{char} is a non-terminating macro character. + } \IT{(\FU*{MAKE-DISPATCH-MACRO-CHARACTER} \VAR{char} \OP{\VAR{non-term-p}\DF{\NIL} \Op{\VAR{rt}\DF{\kwd{*readtable*}}}})} + { Make \VAR{char} a dispatching macro character. Return \retval{\T}. + } \IT{(\FU*{SET-DISPATCH-MACRO-CHARACTER} \VAR{char} \VAR{sub-char} \VAR{function} \Op{\VAR{rt}\DF{\kwd{*readtable*}}})} + { Make \VAR{function} a dispatch function of \VAR{char} followed by \VAR{sub-char}. Return \retval{\T}. + } \IT{(\FU*{GET-DISPATCH-MACRO-CHARACTER} \VAR{char} \VAR{sub-char} \Op{\VAR{rt}\DF{\kwd{*readtable*}}})} + { \VAR{Dispatch function} associated with \VAR{char} followed by \VAR{sub-char}. + } \end{LIST} @@ -164,90 +217,136 @@ \begin{LIST}{1cm} - \IT{\KWD*{;}\OPn{\VAR{comment}}} + \IT{\KWD*{;}\OPn{\VAR{comment}}} + { Rest of line is a comment. + } - \IT{\KWD{\#\boldmath$|$}\OPn{\VAR{comment}}\KWD{\boldmath$|$\#}} + \IT{\KWD{\#\boldmath$|$}\OPn{\VAR{comment}}\KWD{\boldmath$|$\#}} + { Comment. + } \IT{\KWD*{(}} + { Initiate reading of a list. + } \IT{\KWD{"}}\index{""} + { Begin and end of a string. + } - \IT{\KWD*{'}\VAR{foo}} Quote \VAR{foo}. + \IT{\KWD*{'}\VAR{foo}} + {Quote \VAR{foo}.} \IT{\KWD*{`}\VAR{foo} \KWD*{,}\VAR{bar} \KWD*{,@}\VAR{baz} \KWD*{,.}\VAR{quux} \VAR{bing}} + { Quote \VAR{foo} and \VAR{bing}; but neither \VAR{bar}, nor the lists \VAR{baz} and \VAR{quux} which are spliced into their elements. \VAR{quux} is possibly modified in the process. - - \IT{\KWD{\#\boldmath{$\backslash$}}\VAR{c}} + } + \IT{\KWD{\#\boldmath{$\backslash$}}\VAR{c}} + { \index{\#@\#$\backslash$}% Character \VAR{c}. + } - \IT{\KWD*{\#b}, \KWD*{\#o}, \KWD*{\#x}, \KWD{\#}\VAR{n}\KWD{R}} + \IT{\KWD*{\#b}, \KWD*{\#o}, \KWD*{\#x}, \KWD{\#}\VAR{n}\KWD{R}} + { \index{\#R}% Binary, octal, or hexadecimal number, or number of base \VAR{n}. + } - \IT{\KWD*{\#C(}\VAR{a b}\kwd{)}} Complex number \VAR{a}$+$\VAR{b}i. + \IT{\KWD*{\#C(}\VAR{a b}\kwd{)}} + {Complex number \VAR{a}$+$\VAR{b}i. + } - \IT{\KWD*{\#'}\VAR{foo}} + \IT{\KWD*{\#'}\VAR{foo}} + { Return \retval{function named \VAR{foo}}. + } - \IT{\KWD{\#}\VAR{n}\KWD{A}\OPn{\VAR{foo}}} + \IT{\KWD{\#}\VAR{n}\KWD{A}\OPn{\VAR{foo}}} + { \index{\#A}% \VAR{n}-dimensional array + } - \IT{\KWD{\#}\Op{\VAR{n}}\kwd{(}\OPn{\VAR{foo}}\kwd{)}} + \IT{\KWD{\#}\Op{\VAR{n}}\kwd{(}\OPn{\VAR{foo}}\kwd{)}} + { \index{\#(}% Vector of some, or \VAR{n}, \VAR{foo}s filled with last \VAR{foo} if necessary. + } - \IT{\KWD{\#}\Op{\VAR{n}}\kwd{*}\OPn{\VAR{b}}} + \IT{\KWD{\#}\Op{\VAR{n}}\kwd{*}\OPn{\VAR{b}}} + { \index{\#*}% Bit vector of some, or \VAR{n}, \VAR{b}s filled with last \VAR{b} if necessary. + } - \IT{\KWD*{\#S(}\VAR{type} \Goos{\VAR{slot} \VAR{value}}\kwd{)}} + \IT{\KWD*{\#S(}\VAR{type} \Goos{\VAR{slot} \VAR{value}}\kwd{)}} + { Structure of \VAR{type}. + } - \IT{\KWD*{\#:}\VAR{foo}} + \IT{\KWD*{\#:}\VAR{foo}} + { Uninterned Symbol \VAR{foo}. + } - \IT{\KWD*{\#.}\VAR{form}} + \IT{\KWD*{\#.}\VAR{form}} + { Read-time value of \VAR{form}. + } \IT{\V*{*read-eval*}\DF{\T}} + { If \NIL, a \kwd{reader-error} is signalled by \kwd{\#.}. + } \IT{\KWD{\#}\VAR{label}\kwd{=} \VAR{foo}} + { \index{\#=}% Give value of \VAR{foo} a \VAR{label}. + } - \IT{\KWD{\#}\VAR{label}\kwd{\#}} + \IT{\KWD{\#}\VAR{label}\kwd{\#}} + { \index{\#\#}% \retval{Object labelled \VAR{label}}. + } - \IT{\KWD*{\#P}\VAR{foo}} + \IT{\KWD*{\#P}\VAR{foo}} + { Value of \retval{(\kwd{parse-namestring '}\VAR{foo})}. + } \IT{\KWD{\#\boldmath$<$}} + { \index{\#<@\#$<$}% Have the reader signal an error. + } \IT{\KWD*{\#+}\VAR{test} \VAR{form}} + { Means \VAR{form} if \VAR{test} returns \T, means whitespace otherwise. + } \IT{\KWD*{\#--}\VAR{test} \VAR{form}} + { Means \VAR{form} if \VAR{test} returns \NIL, means whitespace otherwise. + } \IT{\V*{*read-suppress*}\DF{\NIL}} + { Used by \kwd{\#+} and \kwd{\#--}. + } \end{LIST} @@ -264,51 +363,73 @@ \FU*{PPRINT}\\ \FU*{PRINC}}{\}} \VAR{foo} \Op{\VAR{stream}\DF{\kwd{*standard-output*}}})} + { Print \retval{\VAR{foo}} to \VAR{stream} \FU{read}ably, \FU{read}ably after a newline and followed by a space, \FU{read}ably after a newline, or human-readably without any extra characters, resp. + } \IT{\arrGOO{(\FU*{PRIN1-TO-STRING} \VAR{ foo})\\ - (\FU*{PRINC-TO-STRING} \VAR{ foo})}{\}}} + (\FU*{PRINC-TO-STRING} \VAR{ foo})}{.}} + { Print \VAR{foo} to \retval{\VAR{string}} \FU{read}ably or human-readably, resp. + } - \IT{(\GFU*{PRINT-OBJECT} \VAR{object} \VAR{stream})} + \IT{(\GFU*{PRINT-OBJECT} \VAR{object} \VAR{stream})} + { Print \retval{\VAR{object}} to \VAR{stream}. + } \IT{(\FU*{PRINT-UNREADABLE-OBJECT} (\VAR{foo} \VAR{stream} \Op{\kwd{:type} \VAR{bool}} \Op{\kwd{:identity} \VAR{bool}}) - \OPn{\VAR{form}})} + \OPn{\VAR{form}})} + { Enclosed in \kwd{\#\boldmath$<$} and \kwd{\boldmath$>$}, print \VAR{foo} by means of \VAR{form}. Return \retval{\NIL}. + } \IT{(\FU*{TERPRI} \Op{\VAR{stream}\DF{\kwd{*standard-output*}}})} + { Output a newline to \VAR{stream}. Return \retval{\NIL}. + } - \IT{(\FU*{FRESH-LINE}) \Op{\VAR{stream}\DF{\kwd{*standard-output*}}}} + \IT{(\FU*{FRESH-LINE}) + \Op{\VAR{stream}\DF{\kwd{*standard-output*}}}} + { Output a newline to \VAR{stream} and return \retval{\T} unless \VAR{stream} is already at the start of a line. + } - \IT{(\FU*{WRITE-CHAR} \VAR{char} \Op{\VAR{stream}\DF{\kwd{*standard-output*}}}))} + \IT{(\FU*{WRITE-CHAR} \VAR{char} + \Op{\VAR{stream}\DF{\kwd{*standard-output*}}})} + { Output \retval{\VAR{char}} to \VAR{stream}. + } \IT{(\xorGOO{\FU*{WRITE-STRING}\\ \FU*{WRITE-LINE}}{\}} \VAR{string} \OP{\VAR{stream}} \orGOO{\kwd{:start} \VAR{ start}\DF{0}\\\kwd{:end} \VAR{ - end}\DF{\NIL}}{\}})} + end}\DF{\NIL}}{\}})} + { Write \retval{part of \VAR{string} between \VAR{start} and \VAR{end}} to \VAR{stream}, without/with a trailing newline, resp. + } - \IT{(\FU*{WRITE-BYTE} \VAR{byte} \VAR{stream})} + \IT{(\FU*{WRITE-BYTE} \VAR{byte} \VAR{stream})} + { Write one \retval{\VAR{byte}} to \VAR{stream}. + } \IT{(\FU*{WRITE-SEQUENCE} \VAR{sequence} \OP{\VAR{stream}}\orGOO{\kwd{:start}\VAR{ start}\DF{0}\\ - \kwd{:end} \VAR{ end}\DF{\NIL}}{\}})} + \kwd{:end} \VAR{ end}\DF{\NIL}}{\}})} + { Write elements of \retval{\VAR{sequence}} to \VAR{stream}. + } \IT{(\xorGOO{\FU*{WRITE}\\ \FU*{WRITE-TO-STRING}}{\}} \VAR{foo} \orGOO{% @@ -330,58 +451,75 @@ \kwd{:readably} \VAR{ bool}\\ \kwd{:right-margin} \VAR{ int}\\ \kwd{:stream} \VAR{ stream}\DF{\kwd{*standard-output*}}% - }{\}})} + }{\}})} + { Print and return \retval{\VAR{foo}}, or print \VAR{foo} into \retval{string}, resp., after dynamically setting printer variables corresponding to keyword parameters (\kwd{:}\VAR{bar} becoming \kwd{*print-}\VAR{bar}\kwd{*}). (\kwd{:stream} keyword with \FU{write} only.) + } \IT{(\xorGOO{\FU*{PPRINT-FILL}\\ \FU*{PPRINT-LINEAR}}{\}}% - \VAR{stream} \VAR{foo} \OP{\VAR{parenthesis}\DF{\T} \Op{\VAR{noop}}})} + \VAR{stream} \VAR{foo} \OP{\VAR{parenthesis}\DF{\T} + \Op{\VAR{noop}}})} + { Print \VAR{foo} to \VAR{stream}. If \VAR{foo} is a list, print as many elements per line as possible; or print either all elements on one line or each on its own line, resp. Return \retval{\NIL}. + } \IT{(\FU*{PPRINT-TABULAR} \VAR{stream} \VAR{foo} \OP{\VAR{parenthesis}\DF{\T} \Op{\VAR{noop} - \Op{\VAR{n}\DF{16}}}})} + \Op{\VAR{n}\DF{16}}}})} + { Print \VAR{foo} to \VAR{stream}. If \VAR{foo} is a list, print elements in a table with column width \VAR{n} ems. Return \retval{\NIL}. - + } + \IT{(\SF*{PPRINT-LOGICAL-BLOCK} (\VAR{stream} \VAR{list} \orGOO{\xorGOO{\kwd{:prefix} \VAR{ prefix}\\ \kwd{:per-line-prefix} \VAR{ per-line-prefix}}{\}}\\ \kwd{:suffix} \VAR{ suffix}\DF{\LIT{""}}}{\}}) \OPn{(\kwd{declare} \OPn{\VAR{decl}})} \OPn{\VAR{form}})} + { Evaluate \VAR{form}s, which should print \VAR{list}, with \VAR{stream} locally bound to a pretty printing stream which outputs to the original \VAR{stream}. If \VAR{list} is in fact not a list, it is printed by \kwd{write}. + } \begin{LIST}{.5cm} \IT{(\SF*{PPRINT-POP})} + { Take \retval{next element} off \VAR{list}. If there is no remaining list in \VAR{list}, or \V{*print-length*} or \V{*print-circle*} indicate printing should end, send element together with an appropriate indicator to \VAR{stream}. + } \IT{(\FU*{PPRINT-TAB} \Goo{\kwd{:line}\XOR\kwd{:line-relative}% \XOR\kwd{:section}\XOR\kwd{:section-relative}} \VAR{c} \VAR{i} \Op{\VAR{stream}})} + { Move cursor forward to column number $c + ki$, $k \geq 0$ being as small as possible. + } \IT{(\FU*{PPRINT-INDENT}\xorGOO{% \kwd{:block}\\ \kwd{:current}}{\}} \VAR{n} - \OP{\VAR{stream}\DF{\kwd{*standard-output*}}})} + \OP{\VAR{stream}\DF{\kwd{*standard-output*}}})} + { Specify indentation for innermost logical block. Return \retval{\NIL}. + } \IT{(\kwd*{PPRINT-EXIT-IF-LIST-EXHAUSTED})} + { If \VAR{list} is empty, terminate logical block. Return \retval{\NIL} otherwise. + } \end{LIST} @@ -390,72 +528,110 @@ \kwd{:fill}\\ \kwd{:miser}\\ \kwd{:mandatory}}{\}} - \OP{\VAR{stream}\DF{\kwd{*standard-output*}}})} + \OP{\VAR{stream}\DF{\kwd{*standard-output*}}})} + { Print a conditional newline. Return \retval{\NIL}. + } \IT{(\FU*{SET-PPRINT-DISPATCH} \VAR{type} \VAR{function} \OP{\VAR{priority}\DF{0} \Op{\VAR{table}\DF{\kwd{*print-pprint-dispatch*}}}})} + { Install entry comprising \VAR{function} of arguments stream and object to print; and \VAR{priority} as \VAR{type} into \VAR{table}. If \VAR{function} is \NIL, remove \VAR{type} from \VAR{table}. Return \retval{\NIL}. + } \IT{(\FU*{PPRINT-DISPATCH} \VAR{foo} \Op{\VAR{table}\DF{\kwd{*print-pprint-dispatch*}}})} + { Highest priority \retval{\VAR{function}} associated with type of \VAR{foo}. + } \IT{(\FU*{COPY-PPRINT-DISPATCH} - \Op{\VAR{table}\DF{\kwd{*print-pprint-dispatch*}}})} + \Op{\VAR{table}\DF{\kwd{*print-pprint-dispatch*}}})} + { Return \retval{copy of \VAR{table}}. + } \IT{\V*{*print-pretty*}} + { If \T, print pretty. + } - \IT{\V*{*print-case*}\DF{\kwd{:upcase}}} + \IT{\V*{*print-case*}\DF{\kwd{:upcase}}} + { Print symbol names all uppercase (\kwd{:upcase}), all lowercase (\kwd{:downcase}), capitalized (\kwd{:capitalize}). + } \IT{\V*{*print-readably*}\DF{\NIL}} + { If \T, print \FU{read}ably. + } \IT{\V*{*print-array*}} + { If \T, print array \FU{read}ably. + } - \IT{\V*{*print-escape*}\DF{\T}} + \IT{\V*{*print-escape*}\DF{\T}} + { If \NIL, do not print escape characters and package prefixes. + } - \IT{\V*{*print-gensym*}\DF{\T}} + \IT{\V*{*print-gensym*}\DF{\T}} + { If \T, print \kwd{:\#} before uninterned symbols. + } - \IT{\V*{*print-radix*}\DF{\NIL}} + \IT{\V*{*print-radix*}\DF{\NIL}} + { If \T, print rationals with a radix indicator. + } \IT{\V*{*print-base*}\DF{10}} + { Radix for printing rationals, between 2 and 36. + } \IT{\V*{*print-circle*}\DF{\NIL}} + { If \T, avoid indefinite recursion while printing circular structure. + } \IT{\V*{*print-lines*}\DF{\NIL}} + { Number of lines to pretty-print. + } \IT{\V*{*print-length*}\DF{\NIL}} + { If integer, restrict printing of objects to that number per level. + } \IT{\V*{*print-level*}\DF{\NIL}} + { If integer, restrict printing of nested object to that depth. + } \IT{\V*{*print-right-margin*}\DF{\NIL}} + { Right margin width in ems while pretty-printing. + } \IT{\V*{*print-miser-width*}} + { Width below which a compact pretty-printing style is used. + } \IT{\V*{*print-pprint-dispatch*}} + { Current pretty print dispatch table. + } \end{LIST} @@ -469,12 +645,15 @@ \begin{LIST}{1cm} \IT{(\SF*{FORMATTER} \VAR{control})} + { Return \retval{function} of stream and a \kwd{\&rest} argument applying \FU{format} to stream, \VAR{control}, and the \kwd{\&rest} argument returning \NIL\ or any excess arguments. + } \IT{(\FU*{FORMAT} \Goo{\T\XOR\NIL\XOR\VAR{out-string}\XOR\VAR{out-stream}} - \VAR{control} \OPn{arg})} + \VAR{control} \OPn{arg})} + { Output string \VAR{control} which may contain \kwd{\TLD} directives possibly taking some \VAR{args}. Alternatively, \VAR{control} can be a function returned @@ -482,92 +661,128 @@ Output to \VAR{out-string}, \VAR{out-stream}, or, if first argument is \T, to \V{*standard-output*}. Return \retval{\NIL}. If first argument is \NIL, return \retval{formatted output}. + } \begin{LIST}{.5cm} \IT{\KWD{\TLD}\Op{\VAR{min-col}\DF{\LIT{0}} \Op{\KWD{,}\VAR{col-inc}\DF{\LIT{1}} \Op{\KWD{,}\VAR{min-pad}\DF{\LIT{0}} \Op{\KWD{,}\VAR{pad-char}\DF{\LIT{\#$\backslash$Space}}}}}} - \KWD{\Op{:}\Op{@}\Goo{A\XOR S}}} + \KWD{\Op{:}\Op{@}\Goo{A\XOR S}}} + { Print argument of any type for consumption by humans/by the reader, resp. With \kwd{@}, add \VAR{pad-char}s on the left rather than on the right. With \kwd{:} print \NIL\ as \LIT{()} rather than \LIT{nil}. + } \IT{\KWD{\TLD}\Op{\VAR{radix}\DF{\LIT{10}} \Op{\KWD{,}\VAR{width} \Op{\KWD{,}\VAR{pad-char}\DF{\LIT{\#$\backslash$Space}} \Op{\KWD{,}\VAR{comma-char}\DF{\KWD{,}} - \Op{\KWD{,}\VAR{comma-interval}\DF{\LIT{3}}}}}}} \KWD{\Op{:}\Op{@}R}} + \Op{\KWD{,}\VAR{comma-interval}\DF{\LIT{3}}}}}}} + \KWD{\Op{:}\Op{@}R}} + { Print argument as number; with \KWD{:}, group digits \VAR{comma-interval} each; with \kwd{@}, always prepend a sign. + } - \IT{\Goo{\KWD{\TLD R}\XOR\KWD{\TLD :R}\XOR\KWD{\TLD @R}\XOR\KWD{\TLD @:R}}} + \IT{\Goo{\KWD{\TLD R}\XOR\KWD{\TLD :R}\XOR\KWD{\TLD + @R}\XOR\KWD{\TLD @:R}}} + { Take argument as number and print it as English cardinal number, as English ordinal number, as Roman numeral, or as old Roman numeral, resp. + } \IT{\KWD{\TLD}\Op{\VAR{width} \Op{\KWD{,}\VAR{pad-char}\DF{\LIT{\#$\backslash$Space}} \Op{\KWD{,}\VAR{comma-char}\DF{\KWD{,}} \Op{\KWD{,}\VAR{comma-interval}\DF{\LIT{3}}}}}} \KWD{\Op{:}\Op{@}\Goo{D\XOR B\XOR O\XOR X}}} + { Print integer argument as number (decimal, binary, octal, or hexadecimal, resp.) With \kwd{:} group digits \VAR{comma-interval} each; with \kwd{@}, always prepend a sign. + } \IT{\KWD{\TLD}\Op{\VAR{width} \Op{\KWD{,}\VAR{dec-digits} \Op{\KWD{,}\VAR{shift}\DF{\LIT{0}} \Op{\KWD{,}\VAR{overflow-char} - \Op{\KWD{,}\VAR{pad-char}\DF{\LIT{\#$\backslash$Space}}}}}}} \KWD{\Op{@}F}} + \Op{\KWD{,}\VAR{pad-char}\DF{\LIT{\#$\backslash$Space}}}}}}} + \KWD{\Op{@}F}} + { Print argument as floating-point number. With \kwd{@}, always prepend a sign. + } \IT{\KWD{\TLD}\Op{\VAR{width} \Op{\KWD{,}\VAR{int-digits} \Op{\KWD{,}\VAR{exp-digits} \Op{\KWD{,}\VAR{scale-factor}\DF{\LIT{1}} \Op{\KWD{,}\VAR{overflow-char} \Op{\KWD{,}\VAR{pad-char}\DF{\LIT{\#$\backslash$Space}} - \Op{\KWD{,}\VAR{exp-char}}}}}}}} \KWD{\Op{@}\Goo{E\XOR G}}} + \Op{\KWD{,}\VAR{exp-char}}}}}}}} + \KWD{\Op{@}\Goo{E\XOR G}}} + { Print argument as floating-point number with \VAR{int-digits} before decimal point and \VAR{exp-digits} in the exponent. With \KWD{\TLD G}, chose either \KWD{\TLD E} or \KWD{\TLD F}. With \KWD{@}, always prepend a sign. + } - \IT{\Goo{\KWD{\TLD C}\XOR\KWD{\TLD :C}\XOR\KWD{\TLD @C}\XOR\KWD{\TLD @:C}}} + \IT{\Goo{\KWD{\TLD C}\XOR\KWD{\TLD :C}\XOR\KWD{\TLD + @C}\XOR\KWD{\TLD @:C}}} + { Print, spell out, print in \kwd{\#$\backslash$} syntax, or tell how to type, resp., argument as (possibly non-printing) character. + } \IT{\Goo{% \KWD{\TLD(}\VAR{text}\KWD{\TLD)}\XOR \KWD{\TLD:(}\VAR{text}\KWD{\TLD)}\XOR \KWD{\TLD @(}\VAR{text}\KWD{\TLD)}\XOR \KWD{\TLD:@(}\VAR{text}\KWD{\TLD)}}} + { Convert to lowercase, convert first letter of each word to uppercase, capitalize first word and convert the rest to lowercase, or convert to uppercase, resp. + } \IT{\Goo{\KWD{\TLD P}\XOR\KWD{\TLD:P} \XOR\KWD{\TLD @P}\XOR\KWD{\TLD:@P}}} + { If argument \kwd{eql} 1 print nothing, otherwise print \LIT{s}; do the same after backing up one argument; if argument \kwd{eql} 1 print \LIT{y}, otherwise print \LIT{ies}, do the same after backing up one argument, resp. + } \IT{\Goo{\KWD{\TLD\%}\XOR\KWD{\TLD}\VAR{n}\KWD{\%}}} + { Print one or \VAR{n} newline(s). + } - \IT{\Goo{\KWD{\TLD\&}\XOR\KWD{\TLD}\VAR{n}\KWD{\&}}} + \IT{\Goo{\KWD{\TLD\&}\XOR\KWD{\TLD}\VAR{n}\KWD{\&}}} + { Print one or \VAR{n} newline(s) unless output stream is at the beginning of a line. + } \IT{\Goo{\KWD{\TLD}\_\XOR\KWD{\TLD:}\_\XOR\KWD{\TLD@}\_\XOR\KWD{\TLD}:@\_}} + { Print newline like \kwd{pprint-newline} with argument \kwd{:linear}, \kwd{:fill}, \kwd{:miser}, or \kwd{:mandatory}, resp. + } \IT{\KWD{\TLD}\Op{\KWD{@}}$\hookleftarrow$} + { (Tilde-newline) Ignore newline and following whitespace. With \kwd{@}, ignore only newline. + } \IT{\Goo{\KWD{\TLD\boldmath$|$}\XOR\KWD{\TLD}\VAR{n}\KWD{\boldmath$|$}}} + { Print one or \VAR{n} page separator(s). + } \IT{\Goo{\KWD{\TLD\TLD}\XOR\KWD{\TLD}\VAR{n}\KWD{\TLD}}} + { Print one or \VAR{n} tilde(s). + } \IT{\KWD{\TLD}\Op{\VAR{min-col}\DF{\LIT{0}} \Op{\KWD{,}\VAR{col-inc}\DF{\LIT{1}} @@ -575,58 +790,82 @@ \Op{\KWD{,}\VAR{pad-char}\DF{\LIT{\#$\backslash$Space}}}}}} \KWD{\Op{:}\Op{@}\boldmath{$<$}} \Op{\VAR{text}\KWD{\TLD}\VAR{a},\VAR{b}\kwd{:;}} - \Goos{\VAR{text}\KWD{\TLD;}} \KWD{\TLD\boldmath{$>$}}} + \Goos{\VAR{text}\KWD{\TLD;}} \KWD{\TLD\boldmath{$>$}}} + { Justify text produced by \VAR{text}s in a field of at least \VAR{min-col} columns. + } \IT{\KWD{\TLD}\Op{\VAR{c}\Op{\KWD{,}\VAR{i}}}\Op{\KWD{:}}\Op{\KWD{@}}\KWD{T}} + { Move cursor forward to column number $c + ki$, $k \geq 0$ being as small as possible. + } \IT{\Goo{\KWD{\TLD}\Op{\VAR{n}\DF{\LIT{0}}}\kwd{I}\XOR\KWD{\TLD}\Op{\VAR{n}\DF{\LIT{0}}}\kwd{:I}}} + { Same as (\kwd{pprint-indent} \kwd{:block} \VAR{n}) or (\kwd{pprint-indent} \kwd{:current} \VAR{n}), resp. + } \IT{\KWD{\TLD}\Op{\VAR{n}\DF{\LIT{0}}}\Op{\KWD{:}}\Op{\KWD{@}}\KWD{*}} + { Jump \VAR{n} arguments forward, or, with \kwd{:}, backward. With \kwd{@}, jump to argument \VAR{n}. + } \IT{\KWD{\TLD}\Op{\VAR{limit}}\Op{\KWD{{:}}\Op{\kwd{@}}}% \KWD{\boldmath{$\{$}}\VAR{text}\KWD{\TLD\boldmath{$\}$}}} + { \VAR{text} is used repeatedly, up to \VAR{limit}, as control string for every element of argument, which should be a list. With \kwd{@}, take all remaining arguments. \kwd{:}, argument should be a list of sublists. At each iteration step the elements of a sublist can be used by \VAR{str}. + } \IT{\KWD{\TLD\^{}}} + { Leave immediately \kwd{\TLD\boldmath{$<$}} or \kwd{\TLD\boldmath{$\{$}}. + } \IT{\KWD{\TLD}\Op{\VAR{i}}\Op{\KWD{:}}\Op{\KWD{@}}\KWD{[}\Goos{\VAR{text}\KWD{\TLD;}}\KWD{\TLD]}} + { The \VAR{text}s are clauses the argumenth (or the \VAR{i}th if given) of wich is chosen. With \kwd{:}, the argument is boolean and takes first \VAR{text} for \NIL\ and second \VAR{text} for \T. + } \IT{\KWD{\TLD\Op{@}?}} + { Process two arguments as format string and argument list. With \kwd{@}, take one argument as format string and use then the original argument list + } \IT{\KWD{\TLD\Op{:}\Op{@}/}\VAR{foo}\KWD{/}} + { Call function \VAR{foo} with arguments stream, format-argument, bool-colon, and bool-at for printing format-argument. + } \IT{\KWD{\TLD\Op{:}\Op{@}W}} + { Print obeying every printer control variable. With \kwd{:}, pretty-print. With \kwd{@}, print without limits on length or depth. + } - \IT{\KWD{V}} + \IT{\KWD{V}} + { (Replacing one of the comma-separated prefix parameters) Take next argument as prefix parameter. + } - \IT{\KWD{\#}} + \IT{\KWD{\#}} + { (Replacing one of the comma-separated prefix parameters) Take as prefix parameter the remaining number of unprocessed arguments. + } \end{LIST} @@ -659,114 +898,165 @@ \NIL}{.}\\ \kwd{:external-format } \VAR{format}\DF{\kwd{:default}}% }{\}})} + { Open \retval{stream to \VAR{path}}. + } - \IT{(\FU*{CLOSE} \VAR{stream} \Op{\kwd{:abort} \VAR{bool}\DF{\NIL}})} + \IT{(\FU*{CLOSE} \VAR{stream} \Op{\kwd{:abort} + \VAR{bool}\DF{\NIL}})} + { Close \VAR{stream}. Return \retval{\T} if \VAR{stream} had been open. If \kwd{:abort} is \T, delete associated file. + } \IT{(\FU*{MAKE-STRING-OUTPUT-STREAM} \Op{\kwd{:element-type} - \VAR{type}\DF{\kwd{character}}})} + \VAR{type}\DF{\kwd{character}}})} + { Return a \retval{stream} accepting characters. + } \IT{(\FU*{GET-OUTPUT-STREAM-STRING} \VAR{stream})} + { Clear and return as a \retval{string} characters on \VAR{stream}. + } \IT{(\FU*{MAKE-CONCATENATED-STREAM} \OPn{\VAR{stream}})} + { Return \retval{concatenated stream}. + } - \IT{(\FU*{CONCATENATED-STREAM-STREAMS} \VAR{concatenated-stream})} + \IT{(\FU*{CONCATENATED-STREAM-STREAMS} \VAR{concatenated-stream})} + { Return \retval{list of streams} \VAR{concatenated-stream} still has to read from. + } \IT{(\FU*{MAKE-BROADCAST-STREAM} \OPn{\VAR{stream}})} + { Return \retval{broadcast stream}. + } - \IT{(\FU*{BROADCAST-STREAM-STREAMS} \VAR{broadcast-stream})} + \IT{(\FU*{BROADCAST-STREAM-STREAMS} \VAR{broadcast-stream})} + { Return \retval{list of streams} \VAR{broadcast-stream} is broadcasting to. + } - \IT{(\FU*{MAKE-ECHO-STREAM} \VAR{input-stream} \VAR{output-stream})} + \IT{(\FU*{MAKE-ECHO-STREAM} \VAR{input-stream} \VAR{output-stream})} + { Place \retval{echo stream} between \VAR{input-stream} and \VAR{output-stream}. + } \IT{\arrGOO{(\FU*{ECHO-STREAM-INPUT-STREAM}\VAR{ echo-stream})\\ - (\FU*{ECHO-STREAM-OUTPUT-STREAM}\VAR{ echo-stream})}{\}}} + (\FU*{ECHO-STREAM-OUTPUT-STREAM}\VAR{ echo-stream})}{.}} + { Return \retval{stream} \VAR{echo-stream} receives from or sends to, resp. + } \IT{(\FU*{MAKE-STRING-INPUT-STREAM} \VAR{string} \orGOO{\kwd{:start}\VAR{ start}\\ \kwd{:end} \VAR{ end}}{\}})} + { Return \retval{stream} supplying the characters from \VAR{string}. + } - \IT{(\FU*{MAKE-SYNONYM-STREAM} \VAR{symbol})} + \IT{(\FU*{MAKE-SYNONYM-STREAM} \VAR{symbol})} + { Return \retval{synonym stream}. + } - \IT{(\FU*{SYNONYM-STREAM-SYMBOL} \VAR{synonym-stream})} + \IT{(\FU*{SYNONYM-STREAM-SYMBOL} \VAR{synonym-stream})} + { Return \retval{symbol} of \VAR{synonym-stream}. + } \IT{(\FU*{MAKE-TWO-WAY-STREAM} \VAR{input-stream} - \VAR{output-stream})} Return \retval{two-way stream}. + \VAR{output-stream})} + {Return \retval{two-way stream}. + } \IT{\arrGOO{(\FU*{TWO-WAY-STREAM-INPUT-STREAM} \VAR{ two-way-stream})\\ - (\FU*{TWO-WAY-STREAM-OUTPUT-STREAM} \VAR{ two-way-stream})}{\}}} + (\FU*{TWO-WAY-STREAM-OUTPUT-STREAM} \VAR{ two-way-stream})}{.}} + { Return \retval{stream} \VAR{two-way-stream} receives from or sends to, resp. + } \IT{(\FU*{LISTEN} \Op{\VAR{stream}\DF{\kwd{*standard-input*}}})} + { \retval{\T} if there is a character in input \VAR{stream}. + } \IT{(\FU*{CLEAR-INPUT} \Op{\VAR{stream}\DF{\kwd{*standard-input*}}})} + { Clear input from \VAR{stream}, return \retval{\NIL}. + } \IT{(\xorGOO{\FU*{CLEAR-OUTPUT}\\ \FU*{FORCE-OUTPUT}\\ \FU*{FINISH-OUTPUT}}{\}}% \Op{\VAR{stream}\DF{\kwd{*standard-output*}}})} + { End output to \VAR{stream} and return \retval{\NIL} immediately, after initiating flushing of buffers, or after flushing of buffers, resp. + } \IT{(\SF*{WITH-OPEN-STREAM} (\VAR{foo} \VAR{stream}) - \OPn{(\kwd{declare} \OPn{\VAR{decl}})} \OPn{\VAR{form}})} + \OPn{(\kwd{declare} \OPn{\VAR{decl}})} \OPn{\VAR{form}})} + { Evaluate \VAR{form}s with \VAR{foo} locally bound to \VAR{stream}. Return \retval{values of \VAR{form}s}. + } \IT{(\SF*{WITH-INPUT-FROM-STRING} (\VAR{foo} \VAR{string} \orGOO{\kwd{:index} \VAR{ index}\\\kwd{:start} \VAR{ start}\\\kwd{:end} \VAR{ end}}{\}}) \OPn{(\kwd{declare} - \OPn{\VAR{decl}})} \OPn{\VAR{form}})} + \OPn{\VAR{decl}})} \OPn{\VAR{form}})} + { Evaluate \VAR{form}s with \VAR{foo} locally bound to input stream from \VAR{string}. \VAR{index} contains the reading position in \VAR{string} after leaving. Return \retval{values of \VAR{form}s}. + } \IT{(\SF*{WITH-OUTPUT-TO-STRING} (\VAR{foo} \Op{\VAR{string}}\DF{\NIL} \Op{\kwd{:element-type} \VAR{type}\DF{\kwd{character}}}) \OPn{(\kwd{declare} - \OPn{\VAR{decl}})} \OPn{\VAR{form}})} + \OPn{\VAR{decl}})} \OPn{\VAR{form}})} + { Evaluate \VAR{form}s with \VAR{foo} locally bound to output stream. Append output to \VAR{string} and return \retval{value of \VAR{foo}} if \VAR{string} is given. Return \retval{string containing output} otherwise. + } - \IT{(\FU*{STREAM-EXTERNAL-FORMAT} \VAR{stream})} + \IT{(\FU*{STREAM-EXTERNAL-FORMAT} \VAR{stream})} + { \retval{External file format designator}. + } - \IT{\V*{*terminal-io*}} + \IT{\V*{*terminal-io*}} + { Bidirectional stream to user terminal. + } \IT{\arrGOO{\V*{*standard-input*}\\ \V*{*standard-output*}\\ - \V*{*error-output*}}{\}}} + \V*{*error-output*}}{.}} + { Standard input stream, standard output stream, or standard error output stream, resp. + } \IT{\arrGOO{\V*{*debug-io*}\\ \V*{*query-io*}}{\}}} + { Streams for debugging and user interaction. + } \end{LIST} @@ -785,39 +1075,54 @@ \kwd{:type} \VAR{ type}\\ \kwd{:version} \VAR{ ver}\\ \kwd{:defaults} \VAR{ path}\\ - \kwd{:case \Goo{\kwd{:local}\XOR\kwd{:common}}\DF{\kwd{:local}}}}{\}})} + \kwd{:case + \Goo{\kwd{:local}\XOR\kwd{:common}}\DF{\kwd{:local}}}}{\}})} + { Construct \retval{pathname}. + } \IT{(\FU*{MERGE-PATHNAMES} \VAR{pathname} \OP{\VAR{default-pathname}\DF{\V{*default-pathname-defaults*}} - \Op{\VAR{version}\DF{\kwd{:newest}}}})} + \Op{\VAR{version}\DF{\kwd{:newest}}}})} + { Return \retval{\VAR{pathname}} after filling in missing parts from defaults. + } \IT{\V*{*default-pathname-defaults*}} + { Pathname to use if one is needed but none supplied. + } - \IT{(\FU*{PATHNAME} \VAR{path})} + \IT{(\FU*{PATHNAME} \VAR{path})} + { \retval{Pathname} of \VAR{path}. + } \IT{(\FU*{ENOUGH-NAMESTRING} \VAR{path} \Op{\VAR{root-path}\DF{\V{*default-pathname-defaults*}}})} + { Return \retval{minimal path string} to sufficiently describe path relative to \VAR{root-path.} + } \IT{\arrGOO{(\FU*{NAMESTRING}\VAR{ path})\\ (\FU*{FILE-NAMESTRING}\VAR{ path})\\ (\FU*{DIRECTORY-NAMESTRING}\VAR{ path})\\ - (\FU*{HOST-NAMESTRING}\VAR{ path})}{\}}} + (\FU*{HOST-NAMESTRING}\VAR{ path})}{.}} + { Return string representing \retval{full pathname}, \retval{name, type, and version}, \retval{directory name}, or \retval{host name}, resp., of \VAR{path}. + } \IT{(\FU*{PARSE-NAMESTRING} \VAR{foo} \OP{\VAR{host} \Op{\VAR{default-pathname}\DF{\V{*default-pathname-defaults*}}}} \orGOO{\kwd{:start} \VAR{ start}\DF{\LIT{0}}\\ \kwd{:end} \VAR{ end}\DF{\NIL}\\ \kwd{:junk-allowed} \VAR{ bool}\DF{\NIL}}{\}})} + { Return \retval{pathname} converted from string, pathname, or stream \VAR{foo}; and \retvalii{position} where parsing stopped. + } \IT{(\xorGOO{\FU*{PATHNAME-HOST}\\ \FU*{PATHNAME-DEVICE}\\ @@ -828,73 +1133,109 @@ \VAR{path} \Op{\kwd{:case}\xorGOO{\kwd{:local}\\ \kwd{:common}}{\}}\DF{\kwd{:local}}})} + { Return \retval{pathname component}. + } \IT{(\FU*{LOGICAL-PATHNAME} \VAR{path})} + { \retval{Logical name} of \VAR{path}. + } \IT{(\FU*{TRANSLATE-PATHNAME} \VAR{path-a} \VAR{path-b} \VAR{path-c})} + { Translate \VAR{path-a} from wildcard \VAR{path-b} into wildcard \VAR{path-c}. Return \retval{new path}. + } \IT{(\FU*{LOGICAL-PATHNAME-TRANSLATIONS} \VAR{host})} + { \retval{\VAR{host}'s list of translations}. + } \IT{(\FU*{LOAD-LOGICAL-PATHNAME-TRANSLATIONS} \VAR{host})} + { Load \VAR{host}'s translations. Return \retval{\NIL} if already loded, return \retval{\T} if successful. + } - \IT{(\FU*{TRANSLATE-LOGICAL-PATHNAME} \VAR{path})} + \IT{(\FU*{TRANSLATE-LOGICAL-PATHNAME} \VAR{path})} + { Physical \retval{pathname} of \VAR{path}. + } \IT{\arrGOO{(\FU*{PROBE-FILE} \VAR{file})\\ - (\FU*{TRUENAME} \VAR{file})}{\}}} + (\FU*{TRUENAME} \VAR{file})}{.}} + { \retval{Canonical name} of \VAR{file}. If \VAR{file} does not exist, return \retval{\NIL}/signal error, resp. + } - \IT{(\FU*{FILE-WRITE-DATE} \VAR{file})} + \IT{(\FU*{FILE-WRITE-DATE} \VAR{file})} + { Return \retval{time} at which \VAR{file} was last written. + } \IT{(\FU*{FILE-AUTHOR} \VAR{file})} + { Return \retval{name of \VAR{file} owner}. + } \IT{(\FU*{FILE-LENGTH} \VAR{stream})} + { Return \retval{length of \VAR{stream}}. + } \IT{(\FU*{FILE-POSITION} \VAR{stream} \Op{\orGOO{\kwd{:start}\\ \kwd{:end}\\ \VAR{position}}{\}}})} + { Return \retval{position within stream}, or set it to \retval{\VAR{position}} and return \retval{\T} on success. + } - \IT{(\FU*{FILE-STRING-LENGTH} \VAR{stream} \VAR{foo})} + \IT{(\FU*{FILE-STRING-LENGTH} \VAR{stream} \VAR{foo})} + { \retval{Length} \VAR{foo} would have in \VAR{stream}. + } \IT{(\FU*{RENAME-FILE} \VAR{foo} \VAR{bar})} + { Rename file \VAR{foo} to \VAR{bar}. Unspecified parts of path \VAR{bar} default to those of \VAR{foo}. Return \retval{new pathname}, \retvalii{old file name}, and \retvaliii{new file name}. + } \IT{(\FU*{DELETE-FILE} \VAR{file})} + { Delete \VAR{file}, return \retval{\T}. + } \IT{(\FU*{DIRECTORY} \VAR{path})} + { Return \retval{list of pathnames}. + } \IT{(\FU*{ENSURE-DIRECTORIES-EXIST} \VAR{path} \Op{\kwd{:verbose} \VAR{bool}})} + { Create parts of \retval{\VAR{path}} if necessary. Second return value is \retvalii{\T} if something was created. + } \IT{(\SF*{WITH-OPEN-FILE} (\VAR{stream path} \OPn{\VAR{option-form}}) \OPn{(\kwd{declare} \OPn{\VAR{decl}})} - \OPn{\VAR{form}})} + \OPn{\VAR{form}})} + { Use \FU*{OPEN} with arguments \VAR{option-form}s to temporarily create \VAR{stream}, and return \retval{values of \VAR{form}s}. + } - \IT{(\FU*{USER-HOMEDIR-PATHNAME} \Op{\VAR{host}})} + \IT{(\FU*{USER-HOMEDIR-PATHNAME} \Op{\VAR{host}})} + { User's \retval{home directory}. + } \end{LIST} diff --git a/clqr-numbers.tex b/clqr-numbers.tex index 8d3de1f..3c762bb 100644 --- a/clqr-numbers.tex +++ b/clqr-numbers.tex @@ -19,16 +19,19 @@ \IT{\arrGOO{(\FU{\boldmath$=$}\OPn{\VAR{ number}})\\ - (\FU{\boldmath$/=$}\OPn{\VAR{ number}})}{\}}} - \index{=}% - \index{/=}% - Return \retval{\T} if all \VAR{number}s, or - none, resp., are equal. + (\FU{\boldmath$/=$}\OPn{\VAR{ number}})}{.}} + { + \index{=}% + \index{/=}% + Return \retval{\T} if all \VAR{number}s, or + none, resp., are equal. + } \IT{\arrGOO{(\FU{\boldmath$>$}\RP{\VAR{ number}})\\(\FU{\boldmath$>=$}\RP{\VAR{ number}})\\(\FU{\boldmath$<$}\RP{\VAR{ - number}})\\(\FU{\boldmath$<=$}\RP{\VAR{ number}})}{\}}} + number}})\\(\FU{\boldmath$<=$}\RP{\VAR{ number}})}{.}} + { \index{>@$>$}% \index{>=@$>=$}% \index{<@$<$}% @@ -36,28 +39,40 @@ Return \retval{\T} if \VAR{number}s are monotonically decreasing, monotonically non-increasing, monotonically increasing, or monotonically non-decreasing, resp. + } \IT{\arrGOO{(\FU*{MINUSP} \VAR{ a})\\(\FU*{ZEROP} \VAR{ a})\\(\FU*{PLUSP} - \VAR{ a})}{\}}} + \VAR{ a})}{\}}} + { Return \retval{\T} if $a < 0$, $a = 0$, or $a > 0$, resp. + } - \IT{(\xorGOO{\FU*{EVENP}\\\FU*{ODDP}}{\}} \VAR{integer})} Return \retval{\T} - if \VAR{integer} is even, or odd, resp. + \IT{(\xorGOO{\FU*{EVENP}\\\FU*{ODDP}}{\}} \VAR{integer})} + { + Return \retval{\T} if \VAR{integer} is even, or odd, resp. + } \IT{\arrGOO{(\FU*{NUMBERP} \VAR{ foo})\\ (\FU*{INTEGERP} \VAR{ foo})\\ (\FU*{RATIONALP} \VAR{ foo})\\ (\FU*{FLOATP} \VAR{ foo})\\ - (\FU*{REALP}) \VAR{ foo})\\ - (\FU*{COMPLEXP} \VAR{ foo})}{\}}} + (\FU*{REALP} \VAR{ foo})\\ + (\FU*{COMPLEXP} \VAR{ foo}) + }{\}}} + { Return \retval{\T} if \VAR{foo} is of indicated type. + } - \IT{(\FU*{LOGBITP} \VAR{i} \VAR{integer})} + \IT{(\FU*{LOGBITP} \VAR{i} \VAR{integer})} + { \retval{\T} if zero-based \VAR{i}th bit of \VAR{integer} is set. + } - \IT{(\FU*{RANDOM-STATE-P} \VAR{foo})} + \IT{(\FU*{RANDOM-STATE-P} \VAR{foo})} + { \retval{\T} if \VAR{foo} is of type random state. + } \end{LIST} @@ -67,129 +82,197 @@ \begin{LIST}{1cm} - \IT{(\FU*{ABS} \VAR{n})} + \IT{(\FU*{ABS} \VAR{n})} + { Return \retval{$|n|$} + } - \IT{\arrGOO{(\FU*{+} \OPn{\VAR{ a}})\\(\FU*{*} \OPn{\VAR{ a}})}{\}}} + \IT{\arrGOO{(\FU*{+} \OPn{\VAR{ a}})\\ + (\FU*{*} \OPn{\VAR{ a}})}{.}} + { Return \retval{$\sum{a}$} or \retval{$\prod{a}$}, resp. Without any \VAR{a}s, return \retval{0} or \retval{1}, resp. + } - \IT{\arrGOO{(\FU*{--} \VAR{ a}\OPn{\VAR{ b}})\\(\FU*{/} \VAR{ a} - \OPn{\VAR{ b}})}{\}}} + \IT{\arrGOO{(\FU*{--} \VAR{ a}\OPn{\VAR{ b}})\\ + (\FU*{/} \VAR{ a} + \OPn{\VAR{ b}})}{.}} + { Return \retval{$a-\sum{b}$} or \retval{$a/\prod{b}$}, resp. Without any \VAR{b}s, return \retval{$-a$} or \retval{$1/a$}, resp. + } - \IT{\arrGOO{(\FU*{1+} \VAR{ a})\\(\FU*{1--} \VAR{ a})}{\}}} Return \retval{$a+1$} or + \IT{\arrGOO{(\FU*{1+} \VAR{ a})\\(\FU*{1--} \VAR{ a})}{\}}} + {Return \retval{$a+1$} or \retval{$a-1$}, resp. + } \IT{(\xorGOO{\SF*{INCF}\\\SF*{DECF}}{\}} \VAR{place} - \Op{\VAR{delta}}\DF{1})} + \Op{\VAR{delta}}\DF{1})} + { Increment or decrement \VAR{place} by \VAR{delta} returning \retval{new value}. + } - \IT{(\FU*{EXP} \VAR{p})} Return \retval{$\mbox{e}^p$}. + \IT{(\FU*{EXP} \VAR{p})} + {Return \retval{$\mbox{e}^p$}. + } - \IT{(\FU*{EXPT} \VAR{b} \VAR{p})} Return \retval{$b^p$}. + \IT{(\FU*{EXPT} \VAR{b} \VAR{p})} + {Return \retval{$b^p$}. + } - \IT{(\FU*{LOG} \VAR{a} \Op{\VAR{b}})} + \IT{(\FU*{LOG} \VAR{a} \Op{\VAR{b}})} + { Return \retval{$\log_b a$} or, without \VAR{b}, \retval{$\ln a$}. + } \IT{\arrGOO{(\FU*{SQRT} \VAR{ n})\\ (\FU*{ISQRT} \VAR{ n})}{\}}} + { Return, in complex or natural numbers, resp., $\sqrt{n}$. + } \IT{\arrGOO{(\FU*{LCM} \OPn{\VAR{ integer}})\\ - (\FU*{GCD} \OPn{\VAR{ integer}})}{\}}} + (\FU*{GCD} \OPn{\VAR{ integer}})}{.}} + { \retval{Least common multiple} or \retval{greatest common denominator}, resp., of \VAR{integer}s. + } - \IT{\CNS*{PI}} + \IT{\CNS*{PI}} + { $\pi$, Ludolph's number. + } \IT{\arrGOO{(\FU*{SIN} \VAR{ a})\\ (\FU*{COS} \VAR{ a})\\ - (\FU*{TAN} \VAR{ a})}{\}}} + (\FU*{TAN} \VAR{ a})}{.}} + { With \VAR{a} in radians, return \retval{$\sin a$}, \retval{$\cos a$}, or \retval{$\tan a$}, resp. + } \IT{\arrGOO{(\FU*{ASIN} \VAR{ a})\\ - (\FU*{ACOS} \VAR{ a})}{\}}} + (\FU*{ACOS} \VAR{ a})}{\}}} + { Return \retval{$\arcsin a$} or \retval{$\arccos a$}, resp., in radians. + } - \IT{(\FU*{ATAN} \VAR{a} \Op{\VAR{b}})} + \IT{(\FU*{ATAN} \VAR{a} \Op{\VAR{b}})} + { Return \retval{$\arctan a$} or \retval{$\arctan \frac{a}{b}$} , in radians. + } \IT{\arrGOO{(\FU*{SINH} \VAR{ a})\\(\FU*{COSH} \VAR{ a})\\(\FU*{TANH} - \VAR{ a})}{\}}} + \VAR{ a})}{\}}} + { Return \retval{$\sinh a$}, \retval{$\cosh a$}, or \retval{$\tanh a$}, resp. + } \IT{\arrGOO{(\FU*{ASINH} \VAR{ a})\\ (\FU*{ACOSH} \VAR{ a}) - \\(\FU*{ATANH} \VAR{ a})}{\}}} + \\(\FU*{ATANH} \VAR{ a})}{\}}} + { Return \retval{$\operatorname{arsinh} a$}, \retval{$\operatorname{acosh} a$}, or \retval{$\operatorname{atanh} a$}, resp. + } - \IT{(\FU*{CIS} \VAR{n})} + \IT{(\FU*{CIS} \VAR{n})} + { Return \retval{$\operatorname{e}^{\operatorname{i} n} = \cos n + \operatorname{i}\sin n$}. + } - \IT{(\FU*{CONJUGATE} \VAR{n})} Return \retval{conjugate of \VAR{n}}. + \IT{(\FU*{CONJUGATE} \VAR{n})} + {Return \retval{conjugate of \VAR{n}}. + } \IT{\arrGOO{(\FU*{NUMERATOR} \VAR{ rational})\\ - (\FU*{DENOMINATOR} \VAR{ rational})}{\}}} + (\FU*{DENOMINATOR} \VAR{ rational})}{.}} + { Return \retval{numerator} or \retval{denominator}, resp., of \VAR{rational}'s canonical form. + } \IT{\arrGOO{(\FU*{REALPART} \VAR{ number})\\ - (\FU*{IMAGPART} \VAR{ number})}{\}}} + (\FU*{IMAGPART} \VAR{ number})}{.}} + { Return \retval{real part} or \retval{imaginary part}, resp., of \VAR{number}. + } \IT{\arrGOO{(\FU*{MAX } \Op{\VAR{num}})\\ (\FU*{MIN } \Op{\VAR{num}})}{\}}} + { Return \retval{greatest} or \retval{least}, resp., of \VAR{num}s. + } \IT{(\xorGOO{% \Goo{\FU*{FLOOR}\XOR\FU*{FFLOOR}}\\ \Goo{\FU*{CEILING}\XOR\FU*{FCEILING}}\\ \Goo{\FU*{TRUNCATE}\XOR\FU*{FTRUNCATE}}\\ \Goo{\FU*{ROUND}\XOR\FU*{FROUND}}}{\}} - \VAR{number} \Op{\VAR{divisor}\DF{1}})} + \VAR{number} \Op{\VAR{divisor}\DF{1}})} + { Return \retval{quotient} (integer or float, resp.) truncated towards $-\infty$, $+\infty$, $0$, or rounded, resp.; and \retvalii{remainder}. + } \IT{(\xorGOO{\FU*{MOD}\\ - \FU*{REM}}{\}} \VAR{n} \VAR{m})} Same as \kwd{floor} or + \FU*{REM}}{\}} \VAR{n} \VAR{m})} + {Same as \kwd{floor} or \kwd{truncate}, resp., but return \retval{remainder} only. - - \IT{(\FU*{RANDOM} \VAR{limit})} Return non-negative \retval{random + } + + \IT{(\FU*{RANDOM} \VAR{limit})} + { + Return non-negative \retval{random number} less then, and of type of \VAR{limit}. + } \IT{(\FU*{MAKE-RANDOM-STATE} \Op{\VAR{state}\DF{\NIL}})} + { Make \retval{random state object}. + } - \IT{\V*{*random-state*}} + \IT{\V*{*random-state*}} + { Current random state. + } - \IT{(\FU*{FLOAT-SIGN} \VAR{num-a} \Op{\VAR{num-b}\DF{1}})} + \IT{(\FU*{FLOAT-SIGN} \VAR{num-a} \Op{\VAR{num-b}\DF{1}})} + { \retval{\VAR{num-b}} with the sign of \VAR{num-a}. + } - \IT{(\FU*{SIGNUM} \VAR{n})} \retval{Number} of magnitude 1 + \IT{(\FU*{SIGNUM} \VAR{n})} + {\retval{Number} of magnitude 1 representing sign or phase of \VAR{n}. + } - \IT{(\FU*{COMPLEX} \VAR{real} \VAR{imag})} Make a \retval{complex number}. + \IT{(\FU*{COMPLEX} \VAR{real} \VAR{imag})} + {Make a \retval{complex number}. + } - \IT{(\FU*{PHASE} \VAR{number})} \retval{Angle} of \VAR{number}'s polar representation. + \IT{(\FU*{PHASE} \VAR{number})} + {\retval{Angle} of \VAR{number}'s polar representation. + } \IT{\arrGOO{(\FU*{RATIONAL} \VAR{ real})\\ - (\FU*{RATIONALIZE} \VAR{ real})}{\}}} + (\FU*{RATIONALIZE} \VAR{ real})}{\}}} + { Convert \VAR{real} to \retval{rational}. Assume limited/unlimited precision for \VAR{real}. + } - \IT{(\FU*{FLOAT} \VAR{real} \Op{\VAR{prototype}\DF{\kwd{single-float}}})} + \IT{(\FU*{FLOAT} \VAR{real} + \Op{\VAR{prototype}\DF{\kwd{single-float}}})} + { Convert \VAR{real} into \VAR{prototype}-shaped \retval{float}. + } \end{LIST} @@ -200,71 +283,102 @@ \begin{LIST}{1cm} - \IT{(\kwd*{BOOLE} \VAR{operation} \VAR{int-a} \VAR{int-b})} Return - \retval{value} of bit-wise logical \VAR{operation}. \VAR{operation}s are + \IT{(\kwd*{BOOLE} \VAR{operation} \VAR{int-a} \VAR{int-b})} + { + Return + \retval{value} of bit-wise logical \VAR{operation}. \VAR{operation}s + are + } + \begin{LIST}{.5cm} - \IT{\CNS*{BOOLE-1}} \retval{\VAR{int-a}}. - \IT{\CNS*{BOOLE-2}} \retval{\VAR{int-b}}. - \IT{\CNS*{BOOLE-C1}} \retval{Two's complement of \VAR{int-a}}. - \IT{\CNS*{BOOLE-C2}} \retval{Two's complement of \VAR{int-b}}. - \IT{\CNS*{BOOLE-AND}} \retval{$\text{\VAR{int-a}}\land\text{\VAR{int-b}}$}. - \IT{\CNS*{BOOLE-ANDC1}} \retval{Two's complement of \VAR{int-a} $\land$ \VAR{int-b}}. - \IT{\CNS*{BOOLE-ANDC2}} \retval{\VAR{int-a} $\land$ two's complement of \VAR{int-b}}. - \IT{\CNS*{BOOLE-CLR}} \retval{All bits zero}. - \IT{\CNS*{BOOLE-EQV}} \retval{$\text{\VAR{int-a}} \equiv \text{\VAR{int-b}}$}. - \IT{\CNS*{BOOLE-IOR}} \retval{$\text{\VAR{int-a}} \lor \text{\VAR{int-b}}$}. - \IT{\CNS*{BOOLE-NAND}} \retval{$\lnot(\text{\VAR{int-a}} \land \text{\VAR{int-b}})$}. - \IT{\CNS*{BOOLE-NOR}} \retval{$\lnot(\text{\VAR{int-a}} \lor \text{\VAR{int-b}})$}. - \IT{\CNS*{BOOLE-ORC1}} \retval{Two's complement of \VAR{int-a} $\lor$ \VAR{int-b}}. - \IT{\CNS*{BOOLE-ORC2}} \retval{\VAR{int-a} $\lor$ two's complement of \VAR{int-b}}. - \IT{\CNS*{BOOLE-SET}} \retval{All bits set}. - \IT{\CNS*{BOOLE-XOR}} \retval{$\lnot(\text{\VAR{int-a}} \equiv \text{\VAR{int-b}})$}. + \IT{\CNS*{BOOLE-1}} {\retval{\VAR{int-a}}.} + \IT{\CNS*{BOOLE-2}} {\retval{\VAR{int-b}}.} + \IT{\CNS*{BOOLE-C1}} {\retval{Two's complement of \VAR{int-a}}.} + \IT{\CNS*{BOOLE-C2}} {\retval{Two's complement of \VAR{int-b}}.} + \IT{\CNS*{BOOLE-AND}} {\retval{$\text{\VAR{int-a}}\land\text{\VAR{int-b}}$}.} + \IT{\CNS*{BOOLE-ANDC1}} {\retval{Two's complement of \VAR{int-a} $\land$ \VAR{int-b}}.} + \IT{\CNS*{BOOLE-ANDC2}} {\retval{\VAR{int-a} $\land$ two's complement of \VAR{int-b}}.} + \IT{\CNS*{BOOLE-CLR}} {\retval{All bits zero}.} + \IT{\CNS*{BOOLE-EQV}} {\retval{$\text{\VAR{int-a}} \equiv \text{\VAR{int-b}}$}.} + \IT{\CNS*{BOOLE-IOR}} {\retval{$\text{\VAR{int-a}} \lor \text{\VAR{int-b}}$}.} + \IT{\CNS*{BOOLE-NAND}} {\retval{$\lnot(\text{\VAR{int-a}} \land \text{\VAR{int-b}})$}.} + \IT{\CNS*{BOOLE-NOR}} {\retval{$\lnot(\text{\VAR{int-a}} \lor \text{\VAR{int-b}})$}.} + \IT{\CNS*{BOOLE-ORC1}} {\retval{Two's complement of \VAR{int-a} $\lor$ \VAR{int-b}}.} + \IT{\CNS*{BOOLE-ORC2}} {\retval{\VAR{int-a} $\lor$ two's complement of \VAR{int-b}}.} + \IT{\CNS*{BOOLE-SET}} {\retval{All bits set}.} + \IT{\CNS*{BOOLE-XOR}} {\retval{$\lnot(\text{\VAR{int-a}} \equiv \text{\VAR{int-b}})$}.} \end{LIST} \IT{\arrGOO{(\FU*{LOGAND} \OPn{\VAR{ integer}})\\ - (\FU*{LOGEQV} \OPn{\VAR{ integer}})}{\}}} + (\FU*{LOGEQV} \OPn{\VAR{ integer}})}{.}} + { Return \retval{value of anded or exclusive-nored \VAR{integer}s}, resp. Without any \VAR{integer}, return \retval{$-1$}. + } \IT{(\FU*{LOGANDC1} \VAR{ int-a} \VAR{ int-b})} + { \retval{Two's complement of \VAR{int-a} $\land$ \VAR{int-b}}. + } \IT{(\FU*{LOGORC1} \VAR{ int-a} \VAR{ int-b})} + { \retval{Two's complement of \VAR{int-a} $\lor$ \VAR{int-b}}. + } \IT{(\FU*{LOGANDC2} \VAR{ int-a} \VAR{ int-b})} + { \retval{\VAR{int-a} $\land$ two's complement of \VAR{int-b}}. + } \IT{(\FU*{LOGORC2} \VAR{ int-a} \VAR{ int-b})} + { \retval{\VAR{int-a} $\lor$ two's complement of \VAR{int-b}}. + } \IT{(\FU*{LOGNAND} \VAR{ int-a} \VAR{ int-b})} + { \retval{$\lnot(\text{\VAR{int-a}} \land \text{\VAR{int-b}})$}. + } \IT{(\FU*{LOGNOR} \VAR{ int-a} \VAR{ int-b})} + { \retval{$\lnot(\text{\VAR{int-a}} \lor \text{\VAR{int-b}})$}. + } - \IT{(\FU*{LOGCOUNT} \VAR{integer})} Return \retval{number of bits} set + \IT{(\FU*{LOGCOUNT} \VAR{integer})} + {Return \retval{number of bits} set in \VAR{integer}. + } - \IT{(\FU*{LOGTEST} \VAR{int-a} \VAR{int-b})} Return \retval{\T} if + \IT{(\FU*{LOGTEST} \VAR{int-a} \VAR{int-b})} + {Return \retval{\T} if there is any bit set in \VAR{int-a} which ist set in \VAR{int-b} as well. + } \IT{\arrGOO{(\FU*{LOGIOR} \OPn{\VAR{ integer}})\\ - (\FU*{LOGXOR} \OPn{\VAR{ integer}})}{\}}} + (\FU*{LOGXOR} \OPn{\VAR{ integer}})}{.}} + { Return \retval{value of ored or exclusive-ored \VAR{integer}s}, resp. Without any \VAR{integer}, return \retval{0}. + } - \IT{(\FU*{LOGNOT}\VAR{ integer})} Return \retval{two's complement of \VAR{integer}}. + \IT{(\FU*{LOGNOT}\VAR{ integer})} + {Return \retval{two's complement of \VAR{integer}}. + } - \IT{(\FU*{ASH} \VAR{integer} \VAR{count})} + \IT{(\FU*{ASH} \VAR{integer} \VAR{count})} + { Return \retval{integer} arithmetically shifted left with zeros added at the right, or, for $\VAR{count}<0$, shifted right discarding bits. + } \IT{(\FU*{MASK-FIELD} \VAR{byte-spec} \VAR{integer})} + { Return \retval{\VAR{integer}} with all bits but those denoted by \VAR{byte-spec} unset. \kwd{setf}able. + } \end{LIST} @@ -274,33 +388,46 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \begin{LIST}{1cm} - \IT{(\FU*{INTEGER-LENGTH} \VAR{integer})} + \IT{(\FU*{INTEGER-LENGTH} \VAR{integer})} + { \retval{Number of bits} necessary to represent \VAR{integer}. + } \IT{(\FU*{LDB-TEST} \VAR{byte-spec} \VAR{integer})} + { Return \retval{\T} if any bit specified by \VAR{byte-spec} in \VAR{integer} is set. + } \IT{(\FU*{LDB} \VAR{byte-spec} \VAR{integer})} + { Extract \retval{byte} denoted by \VAR{byte-spec} from \VAR{integer}. \kwd{setf}able. + } \IT{(\FU*{BYTE} \VAR{size} \VAR{position})} + { \retval{Byte specifier} for a byte of \VAR{size} bits starting at a weight of $2^{\VAR{position}}$. + } \IT{(\FU*{BYTE-POSITION} \VAR{byte-spec})} + { \retval{Position} of \VAR{byte-spec}. + } \IT{(\FU*{BYTE-SIZE} \VAR{byte-spec})} + { \retval{Size} of \VAR{byte-spec}. - + } \IT{(\xorGOO{\FU*{DEPOSIT-FIELD}\\ \FU*{DPB}}{\}} \VAR{int-a} \VAR{byte-spec} \VAR{int-b})} + { Return \retval{\VAR{int-b}} with bits denoted by \VAR{byte-spec} replaced by corresponding bits of \VAR{int-a}, or by the low (\kwd{byte-size} \VAR{byte-spec}) bits of \VAR{int-a}, resp. + } \end{LIST} @@ -313,6 +440,7 @@ \IT{\xorGOO{\CNS{SHORT-FLOAT}\\\CNS{SINGLE-FLOAT}\\\CNS{DOUBLE-FLOAT}\\\CNS{LONG-FLOAT}}{\}}\kwd{-}% \xorGOO{\kwd{EPSILON}\\ \kwd{NEGATIVE-EPSILON}}{\}}} + { \index{SHORT-FLOAT-EPSILON}% \index{SINGLE-FLOAT-EPSILON}% \index{DOUBLE-FLOAT-EPSILON}% @@ -322,6 +450,7 @@ \index{DOUBLE-FLOAT-NEGATIVE-EPSILON}% \index{LONG-FLOAT-NEGATIVE-EPSILON}% Smallest possible number making a difference when added or subtracted, resp. + } \IT{\xorGOO{% \CNS{LEAST-NEGATIVE}\\\CNS{LEAST-NEGATIVE-NORMALIZED}\\ @@ -332,6 +461,7 @@ \kwd{SINGLE-FLOAT}\\ \kwd{DOUBLE-FLOAT}\\ \kwd{LONG-FLOAT}}{\}}} + { \index{LEAST-NEGATIVE-SHORT-FLOAT}% \index{LEAST-NEGATIVE-NORMALIZED-SHORT-FLOAT}% \index{LEAST-NEGATIVE-SINGLE-FLOAT}% @@ -349,6 +479,7 @@ \index{LEAST-POSITIVE-LONG-FLOAT}% \index{LEAST-POSITIVE-NORMALIZED-LONG-FLOAT}% Available numbers closest to $-0$ or $+0$, resp. + } \IT{\xorGOO{\CNS{MOST-NEGATIVE}\\\CNS{MOST-POSITIVE}}{\}}% \kwd{-}% @@ -358,6 +489,7 @@ \kwd{SHORT-FLOAT}\\ \kwd{SINGLE-FLOAT}\\ \kwd{FIXNUM}}{\}}} + { \index{MOST-NEGATIVE-DOUBLE-FLOAT}% \index{MOST-NEGATIVE-LONG-FLOAT}% \index{MOST-NEGATIVE-SHORT-FLOAT}% @@ -369,23 +501,32 @@ \index{MOST-POSITIVE-SINGLE-FLOAT}% \index{MOST-POSITIVE-FIXNUM}% Available numbers closest to $-\infty$ or $+\infty$, resp. + } \IT{\arrGOO{(\FU*{DECODE-FLOAT} \VAR{ n})\\ - (\FU*{INTEGER-DECODE-FLOAT} \VAR{ n})}{\}}} + (\FU*{INTEGER-DECODE-FLOAT} \VAR{ n})}{.}} + { Return \retval{significand}, \retvalii{exponent}, and \retvaliii{sign}. + } \IT{(\FU*{SCALE-FLOAT} \VAR{n} \Op{\VAR{i}})} + { With \VAR{n}'s radix $b$, return $n b^{i}$. + } \IT{\arrGOO{ (\FU*{FLOAT-RADIX} \VAR{ n})\\ (\FU*{FLOAT-DIGITS} \VAR{ n})\\ - (\FU*{FLOAT-PRECISION} \VAR{ n})}{\}}} + (\FU*{FLOAT-PRECISION} \VAR{ n})}{.}} + { \retval{Radix}, \retval{number of digits} in that radix, \retval{precision} in that radix, resp., of float \VAR{n}. + } - \IT{(\FU*{UPGRADED-COMPLEX-PART-TYPE} \VAR{foo})} \retval{Type} of + \IT{(\FU*{UPGRADED-COMPLEX-PART-TYPE} \VAR{foo})} + {\retval{Type} of most specialized complex number able to hold parts of type \VAR{foo}. + } \end{LIST} diff --git a/clqr-packages-and-symbols.tex b/clqr-packages-and-symbols.tex index 7f1ced0..f93ad49 100644 --- a/clqr-packages-and-symbols.tex +++ b/clqr-packages-and-symbols.tex @@ -13,30 +13,44 @@ \begin{LIST}{1cm} \IT{\arrGOO{(\FU*{SYMBOLP} \VAR{ foo})\\ - (\FU*{PACKAGEP} \VAR{ foo})}{\}}} + (\FU*{PACKAGEP} \VAR{ foo})}{.}} + { Return \retval{\T} if \VAR{foo} is of type \kwd{symbol} or \kwd{package}, resp. + } \IT{(\FU*{BOUNDP} \VAR{symbol})} + { \retval{\T} if \VAR{symbol} is a special variable. + } \IT{(\FU*{KEYWORDP} \VAR{foo})} + { \retval{\T} if \VAR{foo} is a keyword. + } - \IT{\KWD*{:}\VAR{foo}} + \IT{\KWD*{:}\VAR{foo}} + { Keyword, evaluates to \retval{:\VAR{foo}} + } \IT{(\kwd*{T})} + { Truth, or \V{*terminal-io*}. + } - \IT{\Goo{(\CNS*{NIL})\XOR{\kwd*{()}}}} + \IT{\Goo{(\CNS*{NIL})\XOR{\kwd*{()}}}} + { Falsehood, the empty list, \V{*standard-input*}, \V{*standard-output*}, or the global environment. + } \IT{(\FU*{MAKE-PACKAGE} \VAR{name} \orGOO{\kwd{:nicknames }(\OPn{\VAR{nick}})\DF{\NIL}\\ \kwd{:use }(\OPn{package})}{\}})} + { Create \retval{package \VAR{name}}. + } \IT{(\kwd*{DEFPACKAGE}\VAR{ foo} \orGOO{\OPn{(\kwd{:use }\OPn{\VAR{from-package}})}\\ @@ -48,98 +62,148 @@ \OPn{(\kwd{:shadow }\OPn{\VAR{symbol}})}\\ \OPn{(\kwd{:shadowing-import-from}\VAR{ package}\OPn{\VAR{ symbol}})}\\ (\kwd{:size }\VAR{int})\\ - }{\}})} + }{\}})} + { Return newly defined or modified \retval{package \VAR{foo}} which inherits symbols exported by \VAR{from-package}s. - + } \IT{(\FU*{RENAME-PACKAGE} \VAR{package} \Op{\OPn{\VAR{nicknames}}\DF{\NIL}})} + { Rename \VAR{package}. Return \retval{renamed package}. + } - \IT{(\kwd*{IN-PACKAGE }\VAR{foo})} + \IT{(\kwd*{IN-PACKAGE }\VAR{foo})} + { Make \retval{package \VAR{foo}} current. + } \IT{(\xorGOO{\FU*{USE-PACKAGE}\\ \FU*{UNUSE-PACKAGE}}{\}} \VAR{packages} \Op{\VAR{package}\DF{\kwd{*package*}}})} + { Make exported symbols of \VAR{packages} available in \VAR{package}, or remove them from \VAR{package}, resp.. Return \retval{\T}. + } - \IT{(\FU*{DELETE-PACKAGE} \VAR{package})} + \IT{(\FU*{DELETE-PACKAGE} \VAR{package})} + { Delete \VAR{package}. Return \retval{\T} if successful. + } - \IT{\V*{*package*}} The current package. + \IT{\V*{*package*}} + {The current package. + } - \IT{(\FU*{LIST-ALL-PACKAGES})} + \IT{(\FU*{LIST-ALL-PACKAGES})} + { \retval{List of registered packages}. + } - \IT{(\FU*{PACKAGE-NAME} \VAR{package})} + \IT{(\FU*{PACKAGE-NAME} \VAR{package})} + { \retval{Name of \VAR{package}}. + } - \IT{(\FU*{PACKAGE-NICKNAMES} \VAR{package})} + \IT{(\FU*{PACKAGE-NICKNAMES} \VAR{package})} + { \retval{List of nicknames} of \VAR{package}. + } \IT{(\FU*{FIND-PACKAGE} \VAR{name})} + { Return \retval{package object} with \VAR{name} (case-sensitive). + } \IT{(\FU*{PACKAGE-USE-LIST} \VAR{package})} + { \retval{List of other packeges} used by \VAR{package}. + } \IT{(\FU*{PACKAGE-USED-BY-LIST} \VAR{package})} + { \retval{List of other packages} using \VAR{package}. + } \IT{(\FU*{MAKE-SYMBOL} \VAR{name})} + { Make fresh, uninterned \retval{symbol \VAR{name}}. + } - \IT{(\FU*{GENSYM} \Op{\VAR{x}\DF{\LIT{G}}})} + \IT{(\FU*{GENSYM} \Op{\VAR{x}\DF{\LIT{G}}})} + { Return fresh symbol \retval{\kwd{\#:}\VAR{x}\VAR{n}}, with \VAR{n} from \V*{*gensym-counter*} which is incremented only in case no \VAR{x} is given. + } \IT{(\FU*{GENTEMP} \OP{\VAR{prefix}\DF{\LIT{T}} - \Op{\VAR{package}\DF{\kwd{*package*}}}})} + \Op{\VAR{package}\DF{\kwd{*package*}}}})} + { Intern fresh \retval{symbol} in \retval{package}. Deprecated. + } \IT{(\FU*{COPY-SYMBOL} \VAR{symbol} \Op{\VAR{props}\DF{\NIL}})} + { Return uninterned \retval{copy of \VAR{symbol}}. If \VAR{props} is \T, the copy has the same value, function, and property list. + } \IT{(\FU*{FIND-ALL-SYMBOLS} \VAR{name})} + { Return \retval{list of symbols} with \VAR{name} from all registered packages. + } - \IT{(\FU*{SYMBOL-PACKAGE} \VAR{symbol})} + \IT{(\FU*{SYMBOL-PACKAGE} \VAR{symbol})} + { Return the \retval{package \VAR{symbol} came from}. + } \IT{(\xorGOO{\FU*{INTERN}\\ \FU*{FIND-SYMBOL}}{\}} \VAR{name} \Op{\VAR{package}})} + { Intern or find, resp., \retval{symbol \VAR{name}} in \VAR{package}. Second return value is one of \retvalii{\kwd{:internal}}, \retvalii{\kwd{:external}}, or \retvalii{\kwd{:inherited}}. + } - \IT{(\kwd*{UNINTERN} \VAR{symbol} \Op{\VAR{package}})} + \IT{(\kwd*{UNINTERN} \VAR{symbol} \Op{\VAR{package}})} + { Remove \VAR{symbol} from \VAR{package}, return \retval{\T} on success. + } \IT{(\xorGOO{\FU*{IMPORT}\\ \FU*{SHADOWING-IMPORT}}{\}}\VAR{symbols} \Op{\VAR{package}\DF{\kwd{*package*}}})} + { Make \VAR{symbols} internal to \VAR{package}. Return \retval{\T}. In case of a name conflict, signal \kwd{package-error}, or shadow the old symbol, resp. + } \IT{(\FU*{SHADOW} \VAR{symbols} \Op{\VAR{package}\DF{\kwd{*package*}}})} + { Add \VAR{symbols} to shadowed list of \VAR{package}. Return \retval{\T}. - + } + \IT{(\FU*{PACKAGE-SHADOWING-SYMBOLS} \VAR{package})} + { \retval{List of shadowing symbols} of \VAR{package}. + } - \IT{(\FU*{EXPORT} \VAR{symbols} \Op{\VAR{package}\DF{\kwd{*package*}}})} + \IT{(\FU*{EXPORT} \VAR{symbols} + \Op{\VAR{package}\DF{\kwd{*package*}}})} + { Make \VAR{symbols} external to \VAR{package}. Return \retval{\T}. + } \IT{(\FU*{UNEXPORT} \VAR{symbols} \VAR{package})} + { Revert \VAR{symbols} to internal status. Return \retval{\T}. + } \IT{(\xorGOO{% \arrGOO{% @@ -150,28 +214,36 @@ \OPn{(\kwd{declare} \OPn{\VAR{decl}})} \OPn{\orGOO{\VAR{tag}\\ \VAR{form}}{\}}})} + { Evaluate \VAR{form}s with \VAR{var} successively bound to all symbols from all registered packages, to all symbols from \VAR{package}, or to all external symbols from \VAR{package}, resp. Return \retval{values of \VAR{result}}. + } \IT{(\SF*{WITH-PACKAGE-ITERATOR} (\VAR{name} \VAR{packages} \Op{\kwd{:internal}\XOR\kwd{:external}\XOR\kwd{:inherited}}) \OPn{(\kwd{declare} \OPn{\VAR{decl}})} \OPn{\VAR{form}})} + { Return \retval{values of \VAR{form}s}. In the body, successive invocations of (\VAR{name}) return: \T\ if a symbol is returned; a symbol from \VAR{packages}; accessibility (\kwd{:internal}, \kwd{:external}, or \kwd{:inherited}); and the package the symbol belongs to. + } \IT{(\FU*{SYMBOL-NAME} \VAR{ symbol})} + { \retval{Name} of \VAR{symbol}. + } \IT{\arrGOO{(\FU*{SYMBOL-FUNCTION} \VAR{ symbol})\\ (\FU*{SYMBOL-VALUE} \VAR{ symbol})\\ - (\FU*{SYMBOL-PLIST} \VAR{ symbol})}{\}}} + (\FU*{SYMBOL-PLIST} \VAR{ symbol})}{.}} + { \retval{Function}, \retval{value}, or \retval{property list}, resp., of \VAR{symbol}. \kwd{setf}able. + } \IT{(\GFU*{DOCUMENTATION} \VAR{foo} \Goo{\kwd*{variable}% @@ -180,18 +252,26 @@ \kwd*{method-combination}\XOR% \kwd*{structure}% \XOR\kwd*{type}\XOR\kwd*{setf}\XOR\T})} + { Return \retval{documentation string} of \VAR{foo} of given type. \kwd{setf}able. + } \IT{(\FU*{REQUIRE} \VAR{module} \Op{\VAR{path-list}})} + { If not in \kwd{*modules*}, try paths in \VAR{path-list} to load module from. Signal \kwd{error} if unsuccessful. Deprecated. + } \IT{(\FU*{PROVIDE} \VAR{module})} + { If not already there, add \VAR{module} to \kwd{*modules*}. Deprecated. + } \IT{\V*{*modules*}} + { List of names of modules loaded into Lisp image. + } \end{LIST} diff --git a/clqr-sequences.tex b/clqr-sequences.tex index 707543f..db95a46 100644 --- a/clqr-sequences.tex +++ b/clqr-sequences.tex @@ -19,14 +19,18 @@ \IT{(\xorGOO{\FU*{EVERY}\\ \FU*{NOTEVERY}}{\}} \VAR{test} - \RP{\VAR{sequence}})} + \RP{\VAR{sequence}})} + { Return \retval{\NIL} or \retval{\T}, resp., as soon as \VAR{test} on any set of corresponding elements of \VAR{sequences} returns \NIL. + } \IT{(\xorGOO{\FU*{NOTANY}\\\FU*{SOME}}{\}} \VAR{test} - \RP{\VAR{sequence}})} + \RP{\VAR{sequence}})} + { Return \retval{\NIL} or \retval{value of \VAR{test}}, resp., as soon as \VAR{test} on any set of elements of \VAR{sequences} returns non-\NIL. + } \IT{(\FU*{MISMATCH} \VAR{sequence-a} \VAR{sequence-b} \orGOO{\kwd{:from-end} \VAR{ bool}\DF{\NIL}\\ @@ -36,11 +40,13 @@ \kwd{:start1} \VAR{ start-sequence-a}\DF{0}\\ \kwd{:end1} \VAR{ end-sequence-a}\DF{\NIL}\\ \kwd{:start2} \VAR{ start-sequence-b}\DF{0}\\ - \kwd{:end2} \VAR{ end-sequence-b}\DF{\NIL}}{\}})} + \kwd{:end2} \VAR{ end-sequence-b}\DF{\NIL}}{\}})} + { Return \retval{position in \VAR{sequence-a}} where \VAR{sequence-a} and \VAR{sequence-b} begin to mismatch. Return \retval{\NIL} if they match entirely. + } \end{LIST} @@ -52,24 +58,35 @@ \IT{(\FU*{MAKE-SEQUENCE} \VAR{sequence-type} \VAR{size} \Op{\kwd{:initial-element} \VAR{foo}})} + { Make \retval{sequence} of \VAR{sequence-type} with \VAR{size} elements. + } - \IT{(\FU*{CONCATENATE} \VAR{type} \OPn{\VAR{sequence}})} + \IT{(\FU*{CONCATENATE} \VAR{type} \OPn{\VAR{sequence}})} + { Return \retval{concatenated sequence} of \VAR{type}. + } - \IT{(\FU*{MERGE} \VAR{type} \VAR{sequence-a} \VAR{sequence-b} \VAR{test} \Op{\kwd{:key} \VAR{function}})} + \IT{(\FU*{MERGE} \VAR{type} \VAR{sequence-a} \VAR{sequence-b} + \VAR{test} \Op{\kwd{:key} \VAR{function}})} + { Return \retval{interleaved sequence} of \VAR{type}. \VAR{sequence-a} and \VAR{sequence-b} are possibly modified. Merged sequence will be sorted if both \VAR{sequence-a} and \VAR{sequence-b} are sorted. + } \IT{(\FU*{FILL} \VAR{sequence} \VAR{foo} \orGOO{\kwd{:start} \VAR{ start}\DF{0}\\ - \kwd{:end} \VAR{ end}\DF{\NIL}}{\}})} + \kwd{:end} \VAR{ end}\DF{\NIL}}{\}})} + { Return \retval{\VAR{sequence}} with elements between \VAR{start} and \VAR{end} set to \VAR{foo}. \VAR{sequence} is modified. + } - \IT{(\FU*{LENGTH} \VAR{sequence})} Return \retval{length of + \IT{(\FU*{LENGTH} \VAR{sequence})} + {Return \retval{length of \VAR{sequence}} (being value of fill pointer if applicable). + } \IT{(\FU*{COUNT} \VAR{foo} \VAR{sequence} \orGOO{\kwd{:from-end} \VAR{ bool}\DF{\NIL}\\ @@ -77,34 +94,48 @@ \kwd{:test-not} \VAR{ function}\\ \kwd{:start} \VAR{ start}\DF{0}\\ \kwd{:end} \VAR{ end}\DF{\NIL}\\ - \kwd{:key} \VAR{ function}}{\}})} + \kwd{:key} \VAR{ function}}{\}})} + { Return \retval{number of \VAR{foo}s in \VAR{sequence}} between \VAR{start} and \VAR{end} satisfying tests. + } \IT{(\xorGOO{\FU*{COUNT-IF}\\ \FU*{COUNT-IF-NOT}}{\}} \VAR{test} \VAR{sequence} \orGOO{\kwd{:from-end} \VAR{ bool}\DF{\NIL}\\ \kwd{:start} \VAR{ start}\DF{0}\\ \kwd{:end} \VAR{ end}\DF{\NIL}\\ - \kwd{:key} \VAR{ function}}{\}})} + \kwd{:key} \VAR{ function}}{\}})} + { Return \retval{number of elements in \VAR{sequence}} between \VAR{start} and \VAR{end} satisfying \VAR{test}. + } - \IT{(\FU*{ELT} \VAR{sequence} \VAR{index})} Return \retval{element of + \IT{(\FU*{ELT} \VAR{sequence} \VAR{index})} + {Return \retval{element of \VAR{sequence}} pointed to by \VAR{index}. \kwd{setf}able. + } - \IT{(\FU*{SUBSEQ} \VAR{sequence} \VAR{start} \Op{\VAR{end}\DF{\NIL}})} + \IT{(\FU*{SUBSEQ} \VAR{sequence} \VAR{start} + \Op{\VAR{end}\DF{\NIL}})} + { Return \retval{subsequence of \VAR{sequence}} between \VAR{start} and \VAR{end}. \kwd{setf}able. + } \IT{(\xorGOO{\FU*{SORT}\\\FU*{STABLE-SORT}}{\}} \VAR{sequence} \VAR{test} - \Op{\kwd{:key} \VAR{function}})} + \Op{\kwd{:key} \VAR{function}})} + { Return \retval{sorted sequence}. \VAR{sequence} is modified. Order of elements considered equal is not guaranteed/retained, resp. + } - \IT{\arrGOO{(\FU*{REVERSE} \VAR{ sequence})\\(\FU*{NREVERSE} \VAR{ sequence})}{\}}} + \IT{\arrGOO{(\FU*{REVERSE} \VAR{ sequence})\\(\FU*{NREVERSE} \VAR{ + sequence})}{.}} + { Return \retval{\VAR{sequence} in reverse order}. \VAR{sequence} is unmodified/possibly modified, resp. + } \IT{(\xorGOO{\FU*{FIND}\\ \FU*{POSITION}}{\}} \VAR{foo} \VAR{sequence} @@ -113,19 +144,23 @@ \kwd{:test-not} \VAR{ function}\\ \kwd{:start} \VAR{ start}\DF{0}\\ \kwd{:end} \VAR{ end}\DF{\NIL}\\ - \kwd{:key} \VAR{ function}}{\}})} + \kwd{:key} \VAR{ function}}{\}})} + { Return \retval{first element} found in \VAR{sequence}, or its \retval{position} relative to \VAR{sequence}'s start, resp., between \VAR{start} and \VAR{end} satisfying tests. + } \IT{(\xorGOO{\FU*{FIND-IF}\\\FU*{FIND-IF-NOT}\\\FU*{POSITION-IF}\\\FU*{POSITION-IF-NOT}}{\}} \VAR{test} \VAR{sequence} \orGOO{\kwd{:from-end} \VAR{ bool}\DF{\NIL}\\ \kwd{:start} \VAR{ start}\DF{0}\\ \kwd{:end} \VAR{ end}\DF{\NIL}\\ - \kwd{:key} \VAR{ function}}{\}})} + \kwd{:key} \VAR{ function}}{\}})} + { Return \retval{first element in \VAR{sequence}}, or \retval{its position} relative to \VAR{sequence}'s start, resp., between \VAR{start} and \VAR{end} satisfying \VAR{test}. + } \IT{(\FU*{SEARCH} \VAR{sequence-a} \VAR{sequence-b} \orGOO{\kwd{:from-end} \VAR{ bool}\DF{\NIL}\\ @@ -136,9 +171,11 @@ \kwd{:end1} \VAR{ end-a}\DF{\NIL}\\ \kwd{:end2} \VAR{ end-b}\DF{\NIL}\\ \kwd{:key} \VAR{ function}}{\}})} + { Search \VAR{sequence-b} for a subsequence matching \VAR{sequence-a}. Return \retval{position} in \VAR{sequence-b}, or \retval{\NIL}. + } \IT{(\xorGOO{\FU*{REMOVE}\\\FU*{DELETE}}{\}} \VAR{foo} \VAR{sequence} \orGOO{\kwd{:from-end} \VAR{ bool}\DF{\NIL}\\ @@ -147,9 +184,11 @@ \kwd{:start} \VAR{ start}\DF{0}\\ \kwd{:end} \VAR{ end}\DF{\NIL}\\ \kwd{:key} \VAR{ function}\\ - \kwd{:count} \VAR{ count}\DF{\NIL}}{\}})} + \kwd{:count} \VAR{ count}\DF{\NIL}}{\}})} + { Make \retval{copy of \VAR{sequence}} without elements matching \VAR{foo}. \VAR{sequence} is unmodified/possibly modified, resp. + } \IT{(\xorGOO{\FU*{REMOVE-IF}\\\FU*{REMOVE-IF-NOT}\\ \FU*{DELETE-IF}\\\FU*{DELETE-IF-NOT}}{\}} @@ -158,10 +197,12 @@ \kwd{:start} \VAR{ start}\DF{0}\\ \kwd{:end} \VAR{ end}\DF{\NIL}\\ \kwd{:key} \VAR{ function}\\ - \kwd{:count} \VAR{ count}\DF{\NIL}}{\}})} + \kwd{:count} \VAR{ count}\DF{\NIL}}{\}})} + { Make \retval{copy of \VAR{sequence}} with all (or \VAR{count}) elements satisfying test or not satisfying test, resp., removed. \VAR{sequence} is unmodified/possibly modified, resp. + } \IT{(\xorGOO{\FU*{REMOVE-DUPLICATES}\\\FU*{DELETE-DUPLICATES}}{\}} \VAR{sequence} \orGOO{\kwd{:from-end} \VAR{ bool}\DF{\NIL}\\ @@ -170,9 +211,11 @@ \kwd{:start} \VAR{ start}\DF{0}\\ \kwd{:end} \VAR{ end}\DF{\NIL}\\ \kwd{:key} \VAR{ function}}{\}})} + { Make \retval{copy of \VAR{sequence}} without duplicates. \VAR{sequence} is unmodified/possibly modified, resp. + } \IT{(\xorGOO{\FU*{SUBSTITUTE}\\\FU*{NSUBSTITUTE}}{\}} \VAR{new} \VAR{old} \VAR{foo} \VAR{sequence} @@ -182,10 +225,12 @@ \kwd{:start} \VAR{ start}\DF{0}\\ \kwd{:end} \VAR{ end}\DF{\NIL}\\ \kwd{:key} \VAR{ function}\\ - \kwd{:count} \VAR{ count}\DF{\NIL}}{\}})} + \kwd{:count} \VAR{ count}\DF{\NIL}}{\}})} + { Make \retval{copy of \VAR{sequence}} with all (or \VAR{count}) \VAR{old}s replaced by \VAR{new}. \VAR{sequence} is unmodified/possibly modified, resp. + } \IT{(\xorGOO{\FU*{SUBSTITUTE-IF}\\\FU*{SUBSTITUTE-IF-NOT}\\ \FU*{NSUBSTITUTE-IF}\\\FU*{NSUBSTITUTE-IF-NOT}}{\}} @@ -194,40 +239,53 @@ \kwd{:start} \VAR{ start}\DF{0}\\ \kwd{:end} \VAR{ end}\DF{\NIL}\\ \kwd{:key} \VAR{ function}\\ - \kwd{:count} \VAR{ count}\DF{\NIL}}{\}})} + \kwd{:count} \VAR{ count}\DF{\NIL}}{\}})} + { Make \retval{copy of \VAR{sequence}} with all (or \VAR{count}) elements satisfying test or not satisfying test, resp., replaced by \VAR{new}. \VAR{sequence} is unmodified/possibly modified, resp. + } \IT{(\FU*{REPLACE} \VAR{sequence-a} \VAR{sequence-b} \orGOO{\kwd{:start1} \VAR{ start-a}\DF{0}\\ \kwd{:start2} \VAR{ start-b}\DF{0}\\ \kwd{:end1} \VAR{ end-a}\DF{\NIL}\\ \kwd{:end2} \VAR{ end-b}\DF{\NIL}}{\}})} + { Destructively replace elements of \retval{\VAR{sequence-a}} with elements of \VAR{sequence-b}. + } - \IT{(\FU*{MAP} \VAR{type} \VAR{function} \RP{\VAR{sequence}})} + \IT{(\FU*{MAP} \VAR{type} \VAR{function} \RP{\VAR{sequence}})} + { Apply \VAR{function} successively to corresponding elements of the \VAR{sequence}s. Return values as a \retval{sequence of \VAR{type}}. If \VAR{type} is \NIL, return \retval{\NIL}. + } - \IT{(\FU*{MAP-INTO} \VAR{result-sequence} \VAR{function} \RP{\VAR{sequence}})} + \IT{(\FU*{MAP-INTO} \VAR{result-sequence} \VAR{function} + \RP{\VAR{sequence}})} + { Modify \retval{\VAR{result-sequence}} successively by applying \VAR{function} to corresponding elements of the \VAR{sequence}s. + } \IT{(\FU*{REDUCE} \VAR{function} \VAR{sequence} \orGOO{\kwd{:initial-value} \VAR{ foo}\DF{\NIL}\\ \kwd{:from-end} \VAR{ bool}\DF{\NIL}\\ \kwd{:start} \VAR{ start}\DF{0}\\ \kwd{:end} \VAR{ end}\DF{\NIL}\\ - \kwd{:key} \VAR{ function}}{\}})} + \kwd{:key} \VAR{ function}}{\}})} + { Starting with the first two elements of \VAR{sequence}, apply \VAR{function} successively to its last return value together with the next element of \VAR{sequence}. Return \retval{last value of {function}}. + } - \IT{(\FU*{COPY-SEQ} \VAR{sequence})} + \IT{(\FU*{COPY-SEQ} \VAR{sequence})} + { Return \retval{copy of \VAR{sequence}} with the same elements. + } \end{LIST} diff --git a/clqr-strings.tex b/clqr-strings.tex index 706e9ef..345d894 100644 --- a/clqr-strings.tex +++ b/clqr-strings.tex @@ -17,19 +17,23 @@ see pages \pageref{section:Arrays} and \pageref{section:Sequences}. \IT{\arrGOO{(\FU*{STRINGP} \VAR{ foo})\\ - (\FU*{SIMPLE-STRING-P} \VAR{ foo})}{\}}} + (\FU*{SIMPLE-STRING-P} \VAR{ foo})}{.}} + { Return \retval{\T} if \VAR{foo} is of type \kwd{string} or \kwd{simple-string}, resp. + } \IT{(\xorGOO{\FU*{STRING=}\\\FU*{STRING-EQUAL}}{\}} \VAR{foo} \VAR{bar} \orGOO{\kwd{:start1} \VAR{ start-foo}\DF{\LIT{0}}\\ \kwd{:end1} \VAR{ end-foo}\DF{\LIT{\NIL}}\\ \kwd{:start2} \VAR{ start-bar}\DF{\LIT{0}}\\ - \kwd{:end2} \VAR{ end-bar}\DF{\LIT{\NIL}}}{\}})} + \kwd{:end2} \VAR{ end-bar}\DF{\LIT{\NIL}}}{\}})} + { Return \retval{\T} if subsequences of \VAR{foo} and \VAR{bar} are equal. Obey/ignore, resp., case. + } \IT{(\xorGOO{\FU*{STRING/=}\\\FU{STRING\boldmath$>$}\\ \FU{STRING\boldmath$>=$}\\\FU{STRING\boldmath$<$}\\ @@ -37,7 +41,8 @@ see pages \pageref{section:Arrays} and \pageref{section:Sequences}. \orGOO{\kwd{:start1} \VAR{ start-foo}\DF{\LIT{0}}\\ \kwd{:end1} \VAR{ end-foo}\DF{\LIT{\NIL}}\\ \kwd{:start2} \VAR{ start-bar}\DF{\LIT{0}}\\ - \kwd{:end2} \VAR{ end-bar}\DF{\LIT{\NIL}}}{\}})} + \kwd{:end2} \VAR{ end-bar}\DF{\LIT{\NIL}}}{\}})} + { \index{string>@STRING$>$}% \index{string>=@STRING$>=$}% \index{string<@STRING$<$}% @@ -46,6 +51,7 @@ see pages \pageref{section:Arrays} and \pageref{section:Sequences}. lexicographically not equal, greater, not less, less, or not greater, resp., then return \retval{character number} from beginning of \VAR{foo} where they begin to differ. Otherwise return \retval{\NIL}. + } \IT{(\xorGOO{\FU*{STRING-NOT-EQUAL}\\ \FU*{STRING-GREATERP}\\ @@ -57,19 +63,25 @@ see pages \pageref{section:Arrays} and \pageref{section:Sequences}. \kwd{:start1} \VAR{ start-foo}\DF{\LIT{0}}\\ \kwd{:end1} \VAR{ end-foo}\DF{\LIT{\NIL}}\\ \kwd{:start2} \VAR{ start-bar}\DF{\LIT{0}}\\ - \kwd{:end2} \VAR{ end-bar}\DF{\LIT{\NIL}}}{\}})} + \kwd{:end2} \VAR{ end-bar}\DF{\LIT{\NIL}}}{\}})} + { If \VAR{foo} is lexicographically not equal, greater, not less, less, or not greater, resp., ignoring case, then return \retval{character number} from beginning of \VAR{foo} where they begin to differ. Otherwise return \retval{\NIL}. + } \IT{(\FU*{STRING} \VAR{x})} + { Convert \VAR{x} (\kwd{symbol}, \kwd{string}, or \kwd{character}) into a \retval{string}. + } \IT{(\FU*{MAKE-STRING} \VAR{size} \orGOO{\kwd{initial-element} \VAR{ char}\\ - \kwd{element-type} \VAR{ type}\DF{\kwd{character}}}{\}})} + \kwd{element-type} \VAR{ type}\DF{\kwd{character}}}{\}})} + { Return \retval{string} of length \VAR{size}. + } \IT{(\xorGOO{\FU{STRING}\\ \FU{NSTRING}}{\}}\kwd{-}\xorGOO{\kwd{CAPITALIZE}\\ @@ -78,6 +90,7 @@ see pages \pageref{section:Arrays} and \pageref{section:Sequences}. \VAR{string} \orGOO{\kwd{:start} \VAR{ start}\DF{\LIT{0}}\\ \kwd{:end} \VAR{ end}\DF{\NIL}}{\}})} + { \index{STRING-CAPITALIZE}% \index{STRING-UPCASE}% \index{STRING-DOWNCASE}% @@ -87,24 +100,31 @@ see pages \pageref{section:Arrays} and \pageref{section:Sequences}. Return \retval{\VAR{string}} (not modified or modified, resp.) with first letter of every word turned into uppercase, all letters uppercase, or all letters lowercase, resp. + } \IT{(\xorGOO{\FU*{STRING-TRIM}\\ \FU*{STRING-LEFT-TRIM}\\ \FU*{STRING-RIGHT-TRIM}}{\}} \VAR{char-bag} \VAR{string})} + { Return \retval{\VAR{string}} with all characters in \VAR{char-bag} removed from both ends, from the beginning, or from the end, resp. + } \IT{\arrGOO{(\FU*{CHAR} \VAR{ string} \VAR{ i})\\ - (\FU*{SCHAR} \VAR{ string} \VAR{ i})}{\}}} + (\FU*{SCHAR} \VAR{ string} \VAR{ i})}{\}}} + { Return \retval{\VAR{i}th character} of string ignoring/obeying, resp., fill pointer. \kwd{setf}able. + } \IT{(\FU*{PARSE-INTEGER} \VAR{string} \orGOO{\kwd{:start} \VAR{ start}\DF{\LIT{0}}\\ \kwd{:end} \VAR{ end}\DF{\NIL}\\ \kwd{:junk-allowed} \VAR{ bool}\DF{\NIL}}{\}})} + { Parse \retval{integer} from \VAR{string}. Second value is \retvalii{index} of parse end in \VAR{string}. + } diff --git a/clqr-structures.tex b/clqr-structures.tex index ae4e606..9aa37d2 100644 --- a/clqr-structures.tex +++ b/clqr-structures.tex @@ -5,10 +5,14 @@ \begin{LIST}{1cm} \IT{(\FU*{SLOT-EXISTS-P} \VAR{foo} \VAR{bar})} + { \retval{\T} if \VAR{foo} has a slot \VAR{bar}. + } \IT{(\FU*{SLOT-BOUNDP} \VAR{instance} \VAR{slot})} + { \retval{\T} if \VAR{slot} in \VAR{instance} is bound. + } \IT{(\SF*{DEFSTRUCT} \GOO{\VAR{name}\XOR @@ -57,23 +61,31 @@ }{\}}} }{\}^{\!\!*}}% )} + { Define structure \retval{\VAR{name}} together with functions \LIT{make-}\VAR{name}, \LIT{copy-}\VAR{name}, and \LIT{p-}\VAR{name}; and accessors \VAR{slot-prefix-slot-name}. + } \IT{(\SF*{WITH-ACCESSORS} (\OPn{(\VAR{var} \VAR{accessor})}) \VAR{instance} \OPn{(\kwd{declare} \OPn{\VAR{decl}})} \OPn{\VAR{form}})} + { Evaluate \VAR{form}s with variables \VAR{var} locally bound to \VAR{accessor}s of \VAR{instance}. Return \retval{values of \VAR{form}s}. + } - \IT{(\FU*{COPY-STRUCTURE} \VAR{structure})} + \IT{(\FU*{COPY-STRUCTURE} \VAR{structure})} + { Return \retval{copy of \VAR{structure}} with shared slot values. + } \IT{(\FU*{SLOT-MAKUNBOUND} \VAR{instance} \VAR{slot})} + { Make \VAR{slot} in \retval{\VAR{instance}} unbound. + } \end{LIST} diff --git a/clqr-system-types-and-classes.tex b/clqr-system-types-and-classes.tex index a187cea..128bfbf 100644 --- a/clqr-system-types-and-classes.tex +++ b/clqr-system-types-and-classes.tex @@ -115,83 +115,126 @@ \begin{LIST}{1cm} \IT{(\FU*{TYPEP} \VAR{foo} \VAR{type} \Op{\VAR{environment}})} + { Return \retval{\T} if \VAR{foo} is of \VAR{type}. + } - \IT{(\FU*{SUBTYPEP} \VAR{type-a} \VAR{type-b} \Op{\VAR{environment}})} + \IT{(\FU*{SUBTYPEP} \VAR{type-a} \VAR{type-b} + \Op{\VAR{environment}})} + { Return \retval{\T} if \VAR{type-a} is a recognizable subtype of \VAR{type-b}, and \retvalii{\NIL} if the relationship could not be determined. + } \IT{(\SF*{THE} \VAR{type} {form})} + { Return \retval{values} of \VAR{form} which are declared to be of \VAR{type}. + } - \IT{(\FU*{COERCE} \VAR{object} \VAR{type})} + \IT{(\FU*{COERCE} \VAR{object} \VAR{type})} + { Coerce \VAR{object} into \VAR{type}. + } \IT{(\SF*{TYPECASE} \VAR{foo} \OPn{(\VAR{type} \OPn{\VAR{form-a}})} \OP{(\xorGOO{\kwd*{OTHERWISE}\\\T}{\}}\OPn{\VAR{form-b}})\DF{\NIL}})} + { Return \retval{values of a \VAR{form-a}} if \VAR{foo} is of this \VAR{type}. Return \retval{values of \VAR{form-b}} otherwise. + } \IT{(\xorGOO{\SF*{CTYPECASE}\\ \SF*{ETYPECASE} }{\}}\VAR{foo} \OPn{(\VAR{type} \OPn{\VAR{form}})})} + { Return \retval{value of a \VAR{form}} if \VAR{foo} is of this \VAR{type}. Signal correctable/non-correctable error, resp. + } - \IT{(\FU*{TYPE-OF} \VAR{foo})} + \IT{(\FU*{TYPE-OF} \VAR{foo})} + { \retval{Type of \VAR{foo}}. + } - \IT{(\kwd*{CHECK-TYPE} \VAR{place} \VAR{type} \Op{\VAR{string}})} + \IT{(\kwd*{CHECK-TYPE} \VAR{place} \VAR{type} \Op{\VAR{string}})} + { Return \retval{\NIL} and signal correctable error if \VAR{place} is not of {type}. + } - \IT{(\FU*{STREAM-ELEMENT-TYPE} \VAR{stream})} + \IT{(\FU*{STREAM-ELEMENT-TYPE} \VAR{stream})} + { Return \retval{type} of \VAR{stream} objects. + } - \IT{(\FU*{ARRAY-ELEMENT-TYPE} \VAR{array})} + \IT{(\FU*{ARRAY-ELEMENT-TYPE} \VAR{array})} + { Element \retval{type} \VAR{array} holds. + } \IT{(\FU*{UPGRADED-ARRAY-ELEMENT-TYPE} \VAR{type} - \Op{\VAR{environment}})} + \Op{\VAR{environment}})} + { \retval{Element type} of most specialized array capable of holding elements of \VAR{type}. + } \IT{(\SF*{DEFTYPE} \VAR{name} \OPn{\VAR{arg}} \OPn{(\kwd{declare} \OPn{\VAR{decl}})} \Op{\VAR{documentation}} \OPn{\VAR{form}})} + { Define new type \retval{\VAR{name}}. + } \IT{(\kwd*{T})} + { Supertype of every type including \kwd{t}; or superclass of every class except \kwd{t}. + } \IT{(\kwd*{NIL})} + { The empty type, subtype of every type. + } \IT{\arrGOO{(\kwd{EQL} \VAR{foo})\\ (\kwd{MEMBER} \OPn{\VAR{foo}})}{\}}} + { Type specifier, comprising just \VAR{foo} of \VAR{foo}s, resp. + } - \IT{(\kwd*{SATISFIES} \VAR{name})} + \IT{(\kwd*{SATISFIES} \VAR{name})} + { Type specifier for all objects satisfying predicate \VAR{name}. + } - \IT{(\kwd*{MOD} \VAR{n})} + \IT{(\kwd*{MOD} \VAR{n})} + { Type specifier for all integers $ \ITtab% + \advance\ITrest by -\ITtab% + \repeat% +% + \settowidth{\ITwidth}{% + #1\unskip\hskip1em\hskip\ITrest% + \startexplanation#2% + }% + \item{}% + \ifdim\ITwidth < \LISTlinewidth% Entry fits into a single line + #1\unskip\hskip1em\hskip\ITrest% + \startexplanation#2% + \else% + #1% + \unskip\penalty-10000\startexplanation#2% + \fi% +} +% % \newpagestyle{lispref}[\sffamily\mdseries\slshape]{ \headrule\footrule @@ -291,27 +318,41 @@ \begin{LIST}{1cm} \IT{\kwd{NAME}, \FU{NAME}, \SF{NAME}, \GFU{NAME}, \V{*name*}, - \CNS{name}} + \CNS{name}} + { Symbol defined in Common Lisp; esp. function, special form, generic function, variable, constant. + } - \IT{\VAR{them}\DF{\LIT{foo}}} + \IT{\VAR{them}\DF{\LIT{foo}}} + { Placeholder for actual code. Defaults to \LIT{foo}. + } - \IT{\LIT{me}} + \IT{\LIT{me}} + { Text to input literally, or output literally. + } - \IT{\Op{\VAR{foo}}} + \IT{\Op{\VAR{foo}}} + { Either one \VAR{foo} or nothing. + } - \IT{\OPn{\VAR{foo}}; \Goos{\VAR{foo}}} + \IT{\OPn{\VAR{foo}}; \Goos{\VAR{foo}}} + { Zero or more \VAR{foo}s. + } - \IT{\RP{\VAR{foo}}; \Goop{\VAR{foo}}} + \IT{\RP{\VAR{foo}}; \Goop{\VAR{foo}}} + { One or more \VAR{foo}s. + } - \IT{\VAR{foos}} + \IT{\VAR{foos}} + { English plural denotes a list argument. + } \IT{\Goo{\VAR{foo}\XOR\VAR{bar}\XOR\VAR{baz}}; \xorGOO{ @@ -319,23 +360,34 @@ \VAR{bar}\\ \VAR{baz}% }{.}} + { Either \VAR{foo}, or \VAR{bar}, or \VAR{baz}. + } \IT{\orGOO{ \VAR{foo}\\ \VAR{bar}\\ \VAR{baz} }{.}} + { Anything from none to all of \VAR{foo}, \VAR{bar}, and \VAR{baz}. + } - \IT{\retval{\VAR{foo}}; \retvalii{\VAR{bar}}; \retvaliii{\VAR{baz}}} + \IT{\retval{\VAR{foo}}; \retvalii{\VAR{bar}}; + \retvaliii{\VAR{baz}}} + { \VAR{foo}, \VAR{bar}, \VAR{baz} are 1st, 2nd, and 3rd return value. - + } + \IT{\T} + { \kwd*{T}, or truth. + } \IT{\NIL} + { \kwd*{NIL}, falsehood, or \kwd{()}. + } \end{LIST} \clearpage @@ -366,7 +418,7 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % -%\clearpage % Uncomment this line to save some space +\clearpage % Uncomment this line to save some space % \renewcommand{\indexpagestyle}{lispref} \renewenvironment{theindex}% -- 2.11.4.GIT