| 1 |
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> |
| 2 |
<html> |
| •3 |
<!-- Created by GNU Texinfo 6.8, https://www.gnu.org/software/texinfo/ --> |
| 4 |
<head> |
| 5 |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> |
| 6 |
<title>Special Forms and Functions (GCL SI Manual)</title> |
| 7 |
|
| 8 |
<meta name="description" content="Special Forms and Functions (GCL SI Manual)"> |
| 9 |
<meta name="keywords" content="Special Forms and Functions (GCL SI Manual)"> |
| 10 |
<meta name="resource-type" content="document"> |
| 11 |
<meta name="distribution" content="global"> |
| 12 |
<meta name="Generator" content="makeinfo"> |
| •13 |
<meta name="viewport" content="width=device-width,initial-scale=1"> |
| 14 |
|
| 15 |
<link href="index.html" rel="start" title="Top"> |
| 16 |
<link href="Function-and-Variable-Index.html" rel="index" title="Function and Variable Index"> |
| •17 |
<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents"> |
| 18 |
<link href="index.html" rel="up" title="Top"> |
| 19 |
<link href="Compilation.html" rel="next" title="Compilation"> |
| 20 |
<link href="Streams-and-Reading.html" rel="prev" title="Streams and Reading"> |
| 21 |
<style type="text/css"> |
| 22 |
<!-- |
| •23 |
a.copiable-anchor {visibility: hidden; text-decoration: none; line-height: 0em} |
| 24 |
a.summary-letter {text-decoration: none} |
| 25 |
blockquote.indentedblock {margin-right: 0em} |
| 26 |
div.display {margin-left: 3.2em} |
| 27 |
div.example {margin-left: 3.2em} |
| 28 |
kbd {font-style: oblique} |
| 29 |
pre.display {font-family: inherit} |
| 30 |
pre.format {font-family: inherit} |
| 31 |
pre.menu-comment {font-family: serif} |
| 32 |
pre.menu-preformatted {font-family: serif} |
| 33 |
span.nolinebreak {white-space: nowrap} |
| 34 |
span.roman {font-family: initial; font-weight: normal} |
| 35 |
span.sansserif {font-family: sans-serif; font-weight: normal} |
| •36 |
span:hover a.copiable-anchor {visibility: visible} |
| 37 |
ul.no-bullet {list-style: none} |
| 38 |
--> |
| 39 |
</style> |
| 40 |
|
| 41 |
|
| 42 |
</head> |
| 43 |
|
| 44 |
<body lang="en"> |
| •45 |
<div class="chapter" id="Special-Forms-and-Functions"> |
| 46 |
<div class="header"> |
| 47 |
<p> |
| •48 |
Next: <a href="Compilation.html" accesskey="n" rel="next">Compilation</a>, Previous: <a href="Streams-and-Reading.html" accesskey="p" rel="prev">Streams and Reading</a> [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Function-and-Variable-Index.html" title="Index" rel="index">Index</a>]</p> |
| 49 |
</div> |
| 50 |
<hr> |
| 51 |
<span id="Special-Forms-and-Functions-1"></span><h2 class="chapter">6 Special Forms and Functions</h2> |
| 52 |
|
| •53 |
<dl class="def"> |
| 54 |
<dt id="index-LAMBDA_002dLIST_002dKEYWORDS"><span class="category">Constant: </span><span><strong>LAMBDA-LIST-KEYWORDS</strong><a href='#index-LAMBDA_002dLIST_002dKEYWORDS' class='copiable-anchor'> ¶</a></span></dt> |
| 55 |
<dd><p>Package:LISP |
| 56 |
List of all the lambda-list keywords used in GCL. |
| 57 |
</p> |
| 58 |
|
| 59 |
</dd></dl> |
| 60 |
|
| •61 |
<dl class="def"> |
| 62 |
<dt id="index-THE"><span class="category">Special Form: </span><span><strong>THE</strong><a href='#index-THE' class='copiable-anchor'> ¶</a></span></dt> |
| 63 |
<dd><p>Package:LISP |
| 64 |
</p> |
| 65 |
<p>Syntax: |
| 66 |
</p><div class="example"> |
| 67 |
<pre class="example">(the value-type form) |
| 68 |
</pre></div> |
| 69 |
|
| 70 |
<p>Declares that the value of FORM must be of VALUE-TYPE. Signals an error if |
| 71 |
this is not the case. |
| 72 |
</p> |
| 73 |
|
| 74 |
</dd></dl> |
| 75 |
|
| •76 |
<dl class="def"> |
| 77 |
<dt id="index-SETF"><span class="category">Special Form: </span><span><strong>SETF</strong><a href='#index-SETF' class='copiable-anchor'> ¶</a></span></dt> |
| 78 |
<dd><p>Package:LISP |
| 79 |
</p> |
| 80 |
<p>Syntax: |
| 81 |
</p><div class="example"> |
| 82 |
<pre class="example">(setf {place newvalue}*) |
| 83 |
</pre></div> |
| 84 |
|
| 85 |
<p>Replaces the value in PLACE with the value of NEWVALUE, from left to right. |
| 86 |
Returns the value of the last NEWVALUE. Each PLACE may be any one of the |
| 87 |
following: |
| 88 |
</p><ul class="no-bullet"> |
| 89 |
<li> A symbol that names a variable. |
| 90 |
</li><li> A function call form whose first element is the name of the following |
| 91 |
functions: |
| 92 |
<div class="example"> |
| 93 |
<pre class="example">nth elt subseq rest first ... tenth |
| 94 |
c?r c??r c???r c????r |
| 95 |
aref svref char schar bit sbit fill-poiter |
| 96 |
get getf documentation symbol-value symbol-function |
| 97 |
symbol-plist macro-function gethash |
| 98 |
char-bit ldb mask-field |
| 99 |
apply |
| 100 |
</pre></div> |
| 101 |
<p>where ’?’ stands for either ’a’ or ’d’. |
| 102 |
</p></li><li> the form (THE type place) with PLACE being a place recognized by SETF. |
| 103 |
</li><li> a macro call which expands to a place recognized by SETF. |
| 104 |
</li><li> any form for which a DEFSETF or DEFINE-SETF-METHOD declaration has been |
| 105 |
made. |
| 106 |
</li></ul> |
| 107 |
|
| 108 |
</dd></dl> |
| 109 |
|
| •110 |
<dl class="def"> |
| 111 |
<dt id="index-WHEN"><span class="category">Special Form: </span><span><strong>WHEN</strong><a href='#index-WHEN' class='copiable-anchor'> ¶</a></span></dt> |
| 112 |
<dd><p>Package:LISP |
| 113 |
</p> |
| 114 |
<p>Syntax: |
| 115 |
</p><div class="example"> |
| 116 |
<pre class="example">(when test {form}*) |
| 117 |
</pre></div> |
| 118 |
|
| 119 |
<p>If TEST evaluates to non-NIL, then evaluates FORMs as a PROGN. If not, |
| 120 |
simply returns NIL. |
| 121 |
</p> |
| 122 |
|
| 123 |
</dd></dl> |
| 124 |
|
| •125 |
<dl class="def"> |
| 126 |
<dt id="index-CCASE"><span class="category">Macro: </span><span><strong>CCASE</strong><a href='#index-CCASE' class='copiable-anchor'> ¶</a></span></dt> |
| 127 |
<dd><p>Package:LISP |
| 128 |
</p> |
| 129 |
<p>Syntax: |
| 130 |
</p><div class="example"> |
| 131 |
<pre class="example">(ccase keyplace {({key | ({key}*)} {form}*)}*) |
| 132 |
</pre></div> |
| 133 |
|
| 134 |
<p>Evaluates KEYPLACE and tries to find the KEY that is EQL to the value of |
| 135 |
KEYPLACE. If one is found, then evaluates FORMs that follow the KEY and |
| 136 |
returns the value(s) of the last FORM. If not, signals a correctable error. |
| 137 |
</p> |
| 138 |
|
| 139 |
</dd></dl> |
| 140 |
|
| •141 |
<dl class="def"> |
| 142 |
<dt id="index-MACROEXPAND"><span class="category">Function: </span><span><strong>MACROEXPAND</strong> <em>(form &optional (env nil))</em><a href='#index-MACROEXPAND' class='copiable-anchor'> ¶</a></span></dt> |
| 143 |
<dd><p>Package:LISP |
| 144 |
</p> |
| 145 |
<p>If FORM is a macro form, then expands it repeatedly until it is not a macro |
| 146 |
any more. Returns two values: the expanded form and a T-or-NIL flag |
| 147 |
indicating whether the original form was a macro. |
| 148 |
</p> |
| 149 |
|
| 150 |
</dd></dl> |
| 151 |
|
| •152 |
<dl class="def"> |
| 153 |
<dt id="index-MULTIPLE_002dVALUE_002dCALL"><span class="category">Special Form: </span><span><strong>MULTIPLE-VALUE-CALL</strong><a href='#index-MULTIPLE_002dVALUE_002dCALL' class='copiable-anchor'> ¶</a></span></dt> |
| 154 |
<dd><p>Package:LISP |
| 155 |
</p> |
| 156 |
<p>Syntax: |
| 157 |
</p><div class="example"> |
| 158 |
<pre class="example">(multiple-value-call function {form}*) |
| 159 |
</pre></div> |
| 160 |
|
| 161 |
<p>Calls FUNCTION with all the values of FORMs as arguments. |
| 162 |
</p> |
| 163 |
|
| 164 |
</dd></dl> |
| 165 |
|
| •166 |
<dl class="def"> |
| 167 |
<dt id="index-DEFSETF"><span class="category">Macro: </span><span><strong>DEFSETF</strong><a href='#index-DEFSETF' class='copiable-anchor'> ¶</a></span></dt> |
| 168 |
<dd><p>Package:LISP |
| 169 |
</p> |
| 170 |
<p>Syntax: |
| 171 |
</p><div class="example"> |
| 172 |
<pre class="example">(defsetf access-fun {update-fun [doc] | |
| 173 |
lambda-list (store-var) {decl | doc}* |
| 174 |
{form}*) |
| 175 |
</pre></div> |
| 176 |
|
| 177 |
<p>Defines how to SETF a generalized-variable reference of the form |
| 178 |
(ACCESS-FUN ...). The doc-string DOC, if supplied, is saved as a SETF doc and |
| 179 |
can be retrieved by (documentation ’NAME ’setf). |
| 180 |
</p> |
| 181 |
<div class="example"> |
| 182 |
<pre class="example">(defsetf access-fun update-fun) defines an expansion from |
| 183 |
(setf (ACCESS-FUN arg1 ... argn) value) to (UPDATE-FUN arg1 ... argn value). |
| 184 |
|
| 185 |
(defsetf access-fun lambda-list (store-var) . body) defines a macro which |
| 186 |
</pre></div> |
| 187 |
<p>expands |
| 188 |
</p> |
| 189 |
<div class="example"> |
| 190 |
<pre class="example">(setf (ACCESS-FUN arg1 ... argn) value) into the form |
| 191 |
(let* ((temp1 ARG1) ... (tempn ARGn) (temp0 value)) rest) |
| 192 |
</pre></div> |
| 193 |
<p>where REST is the value of BODY with parameters in LAMBDA-LIST bound to the |
| 194 |
symbols TEMP1 ... TEMPn and with STORE-VAR bound to the symbol TEMP0. |
| 195 |
</p> |
| 196 |
</dd></dl> |
| 197 |
|
| •198 |
<dl class="def"> |
| 199 |
<dt id="index-TAGBODY"><span class="category">Special Form: </span><span><strong>TAGBODY</strong><a href='#index-TAGBODY' class='copiable-anchor'> ¶</a></span></dt> |
| 200 |
<dd><p>Package:LISP |
| 201 |
</p> |
| 202 |
<p>Syntax: |
| 203 |
</p><div class="example"> |
| 204 |
<pre class="example">(tagbody {tag | statement}*) |
| 205 |
</pre></div> |
| 206 |
|
| 207 |
<p>Executes STATEMENTs and returns NIL if it falls off the end. |
| 208 |
</p> |
| 209 |
|
| 210 |
</dd></dl> |
| 211 |
|
| 212 |
|
| •213 |
<dl class="def"> |
| 214 |
<dt id="index-ETYPECASE"><span class="category">Macro: </span><span><strong>ETYPECASE</strong><a href='#index-ETYPECASE' class='copiable-anchor'> ¶</a></span></dt> |
| 215 |
<dd><p>Package:LISP |
| 216 |
</p> |
| 217 |
<p>Syntax: |
| 218 |
</p><div class="example"> |
| 219 |
<pre class="example">(etypecase keyform {(type {form}*)}*) |
| 220 |
</pre></div> |
| 221 |
|
| 222 |
<p>Evaluates KEYFORM and tries to find the TYPE in which the value of KEYFORM |
| 223 |
belongs. If one is found, then evaluates FORMs that follow the KEY and |
| 224 |
returns the value(s) of the last FORM. If not, signals an error. |
| 225 |
</p> |
| 226 |
|
| 227 |
</dd></dl> |
| 228 |
|
| •229 |
<dl class="def"> |
| 230 |
<dt id="index-LET_002a"><span class="category">Special Form: </span><span><strong>LET*</strong><a href='#index-LET_002a' class='copiable-anchor'> ¶</a></span></dt> |
| 231 |
<dd><p>Package:LISP |
| 232 |
</p> |
| 233 |
<p>Syntax: |
| 234 |
</p><div class="example"> |
| 235 |
<pre class="example">(let* ({var | (var [value])}*) {decl}* {form}*) |
| 236 |
</pre></div> |
| 237 |
|
| 238 |
<p>Initializes VARs, binding them to the values of VALUEs (which defaults to NIL) |
| 239 |
from left to right, then evaluates FORMs as a PROGN. |
| 240 |
</p> |
| 241 |
|
| 242 |
</dd></dl> |
| 243 |
|
| •244 |
<dl class="def"> |
| 245 |
<dt id="index-PROG1"><span class="category">Special Form: </span><span><strong>PROG1</strong><a href='#index-PROG1' class='copiable-anchor'> ¶</a></span></dt> |
| 246 |
<dd><p>Package:LISP |
| 247 |
</p> |
| 248 |
<p>Syntax: |
| 249 |
</p><div class="example"> |
| 250 |
<pre class="example">(prog1 first {form}*) |
| 251 |
</pre></div> |
| 252 |
|
| 253 |
<p>Evaluates FIRST and FORMs in order, and returns the (single) value of FIRST. |
| 254 |
</p> |
| 255 |
|
| 256 |
</dd></dl> |
| 257 |
|
| •258 |
<dl class="def"> |
| 259 |
<dt id="index-DEFUN"><span class="category">Special Form: </span><span><strong>DEFUN</strong><a href='#index-DEFUN' class='copiable-anchor'> ¶</a></span></dt> |
| 260 |
<dd><p>Package:LISP |
| 261 |
</p> |
| 262 |
<p>Syntax: |
| 263 |
</p><div class="example"> |
| 264 |
<pre class="example">(defun name lambda-list {decl | doc}* {form}*) |
| 265 |
</pre></div> |
| 266 |
|
| 267 |
<p>Defines a function as the global function definition of the symbol NAME. |
| 268 |
The complete syntax of a lambda-list is: |
| 269 |
({var}* |
| 270 |
[&optional {var | (var [initform [svar]])}*] |
| 271 |
[&rest var] |
| 272 |
[&key {var | ({var | (keyword var)} [initform [svar]])}* |
| 273 |
[&allow-other-keys]] |
| 274 |
[&aux {var | (var [initform])}*]) |
| 275 |
The doc-string DOC, if supplied, is saved as a FUNCTION doc and can be |
| 276 |
retrieved by (documentation ’NAME ’function). |
| 277 |
</p> |
| 278 |
|
| 279 |
</dd></dl> |
| 280 |
|
| •281 |
<dl class="def"> |
| 282 |
<dt id="index-MULTIPLE_002dVALUE_002dBIND"><span class="category">Special Form: </span><span><strong>MULTIPLE-VALUE-BIND</strong><a href='#index-MULTIPLE_002dVALUE_002dBIND' class='copiable-anchor'> ¶</a></span></dt> |
| 283 |
<dd><p>Package:LISP |
| 284 |
</p> |
| 285 |
<p>Syntax: |
| 286 |
</p><div class="example"> |
| 287 |
<pre class="example">(multiple-value-bind ({var}*) values-form {decl}* {form}*) |
| 288 |
</pre></div> |
| 289 |
|
| 290 |
<p>Binds the VARiables to the results of VALUES-FORM, in order (defaulting to |
| 291 |
NIL) and evaluates FORMs in order. |
| 292 |
</p> |
| 293 |
|
| 294 |
</dd></dl> |
| 295 |
|
| •296 |
<dl class="def"> |
| 297 |
<dt id="index-DECLARE"><span class="category">Special Form: </span><span><strong>DECLARE</strong><a href='#index-DECLARE' class='copiable-anchor'> ¶</a></span></dt> |
| 298 |
<dd><p>Package:LISP |
| 299 |
</p> |
| 300 |
<p>Syntax: |
| 301 |
</p><div class="example"> |
| 302 |
<pre class="example">(declare {decl-spec}*) |
| 303 |
</pre></div> |
| 304 |
|
| 305 |
<p>Gives a declaration. Possible DECL-SPECs are: |
| 306 |
(SPECIAL {var}*) |
| 307 |
(TYPE type {var}*) |
| 308 |
where ’TYPE’ is one of the following symbols |
| 309 |
</p><div class="example"> |
| 310 |
<pre class="example">array fixnum package simple-bit-vector |
| 311 |
atom float pathname simple-string |
| 312 |
bignum function random-state simple-vector |
| 313 |
bit hash-table ratio single-float |
| 314 |
bit-vector integer rational standard-char |
| 315 |
character keyword readtable stream |
| 316 |
common list sequence string |
| 317 |
compiled-function long-float short-float string-char |
| 318 |
complex nil signed-byte symbol |
| 319 |
cons null unsigned-byte t |
| 320 |
double-float number simple-array vector |
| 321 |
</pre></div> |
| 322 |
<p>’TYPE’ may also be a list containing one of the above symbols as |
| 323 |
its first element and more specific information later in the list. |
| 324 |
For example |
| 325 |
</p><div class="example"> |
| 326 |
<pre class="example">(vector long-float 80) ; vector of 80 long-floats. |
| 327 |
(array long-float *) ; array of long-floats |
| 328 |
(array fixnum) ; array of fixnums |
| 329 |
(array * 30) ; an array of length 30 but unspecified type |
| 330 |
</pre></div> |
| 331 |
|
| 332 |
<p>A list of 1 element may be replaced by the symbol alone, and a list ending |
| 333 |
in ’*’ may drop the the final ’*’. |
| 334 |
</p><div class="example"> |
| 335 |
<pre class="example">(OBJECT {var}*) |
| 336 |
(FTYPE type {function-name}*) |
| 337 |
eg: ;; function of two required args and optional args and one value: |
| 338 |
(ftype (function (t t *) t) sort reduce) |
| 339 |
;; function with 1 arg of general type returning 1 fixnum as value. |
| 340 |
(ftype (function (t) fixnum) length) |
| 341 |
(FUNCTION function-name ({arg-type}*) {return-type}*) |
| 342 |
(INLINE {function-name}*) |
| 343 |
(NOTINLINE {function-name}*) |
| 344 |
(IGNORE {var}*) |
| 345 |
(OPTIMIZE {({SPEED | SPACE | SAFETY | COMPILATION-SPEED} {0 | 1 | 2 | 3})}*) |
| 346 |
(DECLARATION {non-standard-decl-name}*) |
| 347 |
(:DYNAMIC-EXTENT {var}*) ;GCL-specific. |
| 348 |
</pre></div> |
| 349 |
|
| 350 |
</dd></dl> |
| 351 |
|
| •352 |
<dl class="def"> |
| 353 |
<dt id="index-DEFMACRO"><span class="category">Special Form: </span><span><strong>DEFMACRO</strong><a href='#index-DEFMACRO' class='copiable-anchor'> ¶</a></span></dt> |
| 354 |
<dd><p>Package:LISP |
| 355 |
</p> |
| 356 |
<p>Syntax: |
| 357 |
</p><div class="example"> |
| 358 |
<pre class="example">(defmacro name defmacro-lambda-list {decl | doc}* {form}*) |
| 359 |
</pre></div> |
| 360 |
|
| 361 |
<p>Defines a macro as the global macro definition of the symbol NAME. |
| 362 |
The complete syntax of a defmacro-lambda-list is: |
| 363 |
</p> |
| 364 |
<p>( [&whole var] |
| 365 |
[&environment var] |
| 366 |
{pseudo-var}* |
| 367 |
[&optional {var | (pseudo-var [initform [pseudo-var]])}*] |
| 368 |
{[{&rest | &body} pseudo-var] |
| 369 |
[&key {var | ({var | (keyword pseudo-var)} [initform [pseudo-var]])}* |
| 370 |
[&allow-other-keys]] |
| 371 |
[&aux {var | (pseudo-var [initform])}*] |
| 372 |
| . var}) |
| 373 |
</p> |
| 374 |
<p>where pseudo-var is either a symbol or a list of the following form: |
| 375 |
</p> |
| 376 |
<p>( {pseudo-var}* |
| 377 |
[&optional {var | (pseudo-var [initform [pseudo-var]])}*] |
| 378 |
{[{&rest | &body} pseudo-var] |
| 379 |
[&key {var | ({var | (keyword pseudo-var)} [initform [pseudo-var]])}* |
| 380 |
[ &allow-other-keys ] ] |
| 381 |
[&aux {var | (pseudo-var [initform])}*] |
| 382 |
| . var}) |
| 383 |
</p> |
| 384 |
<p>As a special case, a non-NIL symbol is accepcted as a defmacro-lambda-list: |
| 385 |
(DEFMACRO <name> <symbol> ...) is equivalent to |
| 386 |
(DEFMACRO <name> (&REST <symbol>) ...). |
| 387 |
The doc-string DOC, if supplied, is saved as a FUNCTION doc and can be |
| 388 |
retrieved by (documentation ’NAME ’function). |
| 389 |
See the type doc of LIST for the backquote macro useful for defining macros. |
| 390 |
Also, see the function doc of PPRINT for the output-formatting. |
| 391 |
</p> |
| 392 |
|
| 393 |
</dd></dl> |
| 394 |
|
| •395 |
<dl class="def"> |
| 396 |
<dt id="index-_002aEVALHOOK_002a"><span class="category">Variable: </span><span><strong>*EVALHOOK*</strong><a href='#index-_002aEVALHOOK_002a' class='copiable-anchor'> ¶</a></span></dt> |
| 397 |
<dd><p>Package:LISP |
| 398 |
If *EVALHOOK* is not NIL, its value must be a function that can receive |
| 399 |
two arguments: a form to evaluate and an environment. This function does |
| 400 |
the evaluation instead of EVAL. |
| 401 |
</p> |
| 402 |
|
| 403 |
</dd></dl> |
| 404 |
|
| •405 |
<dl class="def"> |
| 406 |
<dt id="index-FUNCTIONP"><span class="category">Function: </span><span><strong>FUNCTIONP</strong> <em>(x)</em><a href='#index-FUNCTIONP' class='copiable-anchor'> ¶</a></span></dt> |
| 407 |
<dd><p>Package:LISP |
| 408 |
</p> |
| 409 |
<p>Returns T if X is a function, suitable for use by FUNCALL or APPLY. Returns |
| 410 |
NIL otherwise. |
| 411 |
</p> |
| 412 |
|
| 413 |
</dd></dl> |
| 414 |
|
| •415 |
<dl class="def"> |
| 416 |
<dt id="index-LAMBDA_002dPARAMETERS_002dLIMIT"><span class="category">Constant: </span><span><strong>LAMBDA-PARAMETERS-LIMIT</strong><a href='#index-LAMBDA_002dPARAMETERS_002dLIMIT' class='copiable-anchor'> ¶</a></span></dt> |
| 417 |
<dd><p>Package:LISP |
| 418 |
The exclusive upper bound on the number of distinct parameter names that may |
| 419 |
appear in a single lambda-list. Actually, however, there is no such upper |
| 420 |
bound in GCL. |
| 421 |
</p> |
| 422 |
|
| 423 |
</dd></dl> |
| 424 |
|
| •425 |
<dl class="def"> |
| 426 |
<dt id="index-FLET"><span class="category">Special Form: </span><span><strong>FLET</strong><a href='#index-FLET' class='copiable-anchor'> ¶</a></span></dt> |
| 427 |
<dd><p>Package:LISP |
| 428 |
</p> |
| 429 |
<p>Syntax: |
| 430 |
</p><div class="example"> |
| 431 |
<pre class="example">(flet ({(name lambda-list {decl | doc}* {form}*)}*) . body) |
| 432 |
</pre></div> |
| 433 |
|
| 434 |
<p>Evaluates BODY as a PROGN, with local function definitions in effect. BODY is |
| 435 |
the scope of each local function definition. Since the scope does not include |
| 436 |
the function definitions themselves, the local function can reference |
| 437 |
externally defined functions of the same name. See the doc of DEFUN for the |
| 438 |
complete syntax of a lambda-list. Doc-strings for local functions are simply |
| 439 |
ignored. |
| 440 |
</p> |
| 441 |
|
| 442 |
</dd></dl> |
| 443 |
|
| •444 |
<dl class="def"> |
| 445 |
<dt id="index-ECASE"><span class="category">Macro: </span><span><strong>ECASE</strong><a href='#index-ECASE' class='copiable-anchor'> ¶</a></span></dt> |
| 446 |
<dd><p>Package:LISP |
| 447 |
</p> |
| 448 |
<p>Syntax: |
| 449 |
</p><div class="example"> |
| 450 |
<pre class="example">(ecase keyform {({key | ({key}*)} {form}*)}*) |
| 451 |
</pre></div> |
| 452 |
|
| 453 |
<p>Evaluates KEYFORM and tries to find the KEY that is EQL to the value of |
| 454 |
KEYFORM. If one is found, then evaluates FORMs that follow the KEY and |
| 455 |
returns the value(s) of the last FORM. If not, signals an error. |
| 456 |
</p> |
| 457 |
|
| 458 |
</dd></dl> |
| 459 |
|
| •460 |
<dl class="def"> |
| 461 |
<dt id="index-PROG2"><span class="category">Special Form: </span><span><strong>PROG2</strong><a href='#index-PROG2' class='copiable-anchor'> ¶</a></span></dt> |
| 462 |
<dd><p>Package:LISP |
| 463 |
</p> |
| 464 |
<p>Syntax: |
| 465 |
</p><div class="example"> |
| 466 |
<pre class="example">(prog2 first second {forms}*) |
| 467 |
</pre></div> |
| 468 |
|
| 469 |
<p>Evaluates FIRST, SECOND, and FORMs in order, and returns the (single) value |
| 470 |
of SECOND. |
| 471 |
</p> |
| 472 |
|
| 473 |
</dd></dl> |
| 474 |
|
| •475 |
<dl class="def"> |
| 476 |
<dt id="index-PROGV"><span class="category">Special Form: </span><span><strong>PROGV</strong><a href='#index-PROGV' class='copiable-anchor'> ¶</a></span></dt> |
| 477 |
<dd><p>Package:LISP |
| 478 |
</p> |
| 479 |
<p>Syntax: |
| 480 |
</p><div class="example"> |
| 481 |
<pre class="example">(progv symbols values {form}*) |
| 482 |
</pre></div> |
| 483 |
|
| 484 |
<p>SYMBOLS must evaluate to a list of variables. VALUES must evaluate to a list |
| 485 |
of initial values. Evaluates FORMs as a PROGN, with each variable bound (as |
| 486 |
special) to the corresponding value. |
| 487 |
</p> |
| 488 |
|
| 489 |
</dd></dl> |
| 490 |
|
| •491 |
<dl class="def"> |
| 492 |
<dt id="index-QUOTE"><span class="category">Special Form: </span><span><strong>QUOTE</strong><a href='#index-QUOTE' class='copiable-anchor'> ¶</a></span></dt> |
| 493 |
<dd><p>Package:LISP |
| 494 |
</p> |
| 495 |
<p>Syntax: |
| 496 |
</p><div class="example"> |
| 497 |
<pre class="example">(quote x) |
| 498 |
</pre></div> |
| 499 |
<p>or ’x |
| 500 |
Simply returns X without evaluating it. |
| 501 |
</p> |
| 502 |
|
| 503 |
</dd></dl> |
| 504 |
|
| •505 |
<dl class="def"> |
| 506 |
<dt id="index-DOTIMES"><span class="category">Special Form: </span><span><strong>DOTIMES</strong><a href='#index-DOTIMES' class='copiable-anchor'> ¶</a></span></dt> |
| 507 |
<dd><p>Package:LISP |
| 508 |
</p> |
| 509 |
<p>Syntax: |
| 510 |
</p><div class="example"> |
| 511 |
<pre class="example">(dotimes (var countform [result]) {decl}* {tag | statement}*) |
| 512 |
</pre></div> |
| 513 |
|
| 514 |
<p>Executes STATEMENTs, with VAR bound to each number between 0 (inclusive) and |
| 515 |
the value of COUNTFORM (exclusive). Then returns the value(s) of RESULT |
| 516 |
(which defaults to NIL). |
| 517 |
</p> |
| 518 |
|
| 519 |
</dd></dl> |
| 520 |
|
| •521 |
<dl class="def"> |
| 522 |
<dt id="index-SPECIAL_002dFORM_002dP"><span class="category">Function: </span><span><strong>SPECIAL-FORM-P</strong> <em>(symbol)</em><a href='#index-SPECIAL_002dFORM_002dP' class='copiable-anchor'> ¶</a></span></dt> |
| 523 |
<dd><p>Package:LISP |
| 524 |
</p> |
| 525 |
<p>Returns T if SYMBOL globally names a special form; NIL otherwise. |
| 526 |
The special forms defined in Steele’s manual are: |
| 527 |
</p><div class="example"> |
| 528 |
<pre class="example">block if progv |
| 529 |
catch labels quote |
| 530 |
compiler-let let return-from |
| 531 |
declare let* setq |
| 532 |
eval-when macrolet tagbody |
| 533 |
flet multiple-value-call the |
| 534 |
function multiple-value-prog1 throw |
| 535 |
go progn unwind-protect |
| 536 |
</pre></div> |
| 537 |
|
| 538 |
<p>In addition, GCL implements the following macros as special forms, though |
| 539 |
of course macro-expanding functions such as MACROEXPAND work correctly for |
| 540 |
these macros. |
| 541 |
</p> |
| 542 |
<div class="example"> |
| 543 |
<pre class="example">and incf prog1 |
| 544 |
case locally prog2 |
| 545 |
cond loop psetq |
| 546 |
decf multiple-value-bind push |
| 547 |
defmacro multiple-value-list return |
| 548 |
defun multiple-value-set setf |
| 549 |
do or unless |
| 550 |
do* pop when |
| 551 |
dolist prog |
| 552 |
dotimes prog* |
| 553 |
</pre></div> |
| 554 |
|
| 555 |
|
| 556 |
</dd></dl> |
| 557 |
|
| •558 |
<dl class="def"> |
| 559 |
<dt id="index-FUNCTION"><span class="category">Special Form: </span><span><strong>FUNCTION</strong><a href='#index-FUNCTION' class='copiable-anchor'> ¶</a></span></dt> |
| 560 |
<dd><p>Package:LISP |
| 561 |
</p> |
| 562 |
<p>Syntax: |
| 563 |
</p><div class="example"> |
| 564 |
<pre class="example">(function x) |
| 565 |
</pre></div> |
| 566 |
<p>or #’x |
| 567 |
If X is a lambda expression, creates and returns a lexical closure of X in |
| 568 |
the current lexical environment. If X is a symbol that names a function, |
| 569 |
returns that function. |
| 570 |
</p> |
| 571 |
|
| 572 |
</dd></dl> |
| 573 |
|
| •574 |
<dl class="def"> |
| 575 |
<dt id="index-MULTIPLE_002dVALUES_002dLIMIT"><span class="category">Constant: </span><span><strong>MULTIPLE-VALUES-LIMIT</strong><a href='#index-MULTIPLE_002dVALUES_002dLIMIT' class='copiable-anchor'> ¶</a></span></dt> |
| 576 |
<dd><p>Package:LISP |
| 577 |
The exclusive upper bound on the number of values that may be returned from |
| 578 |
a function. Actually, however, there is no such upper bound in GCL. |
| 579 |
</p> |
| 580 |
|
| 581 |
</dd></dl> |
| 582 |
|
| •583 |
<dl class="def"> |
| 584 |
<dt id="index-APPLYHOOK"><span class="category">Function: </span><span><strong>APPLYHOOK</strong> <em>(function args evalhookfn applyhookfn &optional (env nil))</em><a href='#index-APPLYHOOK' class='copiable-anchor'> ¶</a></span></dt> |
| 585 |
<dd><p>Package:LISP |
| 586 |
</p> |
| 587 |
<p>Applies FUNCTION to ARGS, with *EVALHOOK* bound to EVALHOOKFN and with |
| 588 |
*APPLYHOOK* bound to APPLYHOOKFN. Ignores the hook function once, for the |
| 589 |
top-level application of FUNCTION to ARGS. |
| 590 |
</p> |
| 591 |
|
| 592 |
</dd></dl> |
| 593 |
|
| •594 |
<dl class="def"> |
| 595 |
<dt id="index-_002aMACROEXPAND_002dHOOK_002a"><span class="category">Variable: </span><span><strong>*MACROEXPAND-HOOK*</strong><a href='#index-_002aMACROEXPAND_002dHOOK_002a' class='copiable-anchor'> ¶</a></span></dt> |
| 596 |
<dd><p>Package:LISP |
| 597 |
Holds a function that can take two arguments (a macro expansion function |
| 598 |
and the macro form to be expanded) and returns the expanded form. This |
| 599 |
function is whenever a macro-expansion takes place. Initially this is set to |
| 600 |
#’FUNCALL. |
| 601 |
</p> |
| 602 |
|
| 603 |
</dd></dl> |
| 604 |
|
| •605 |
<dl class="def"> |
| 606 |
<dt id="index-PROG_002a"><span class="category">Special Form: </span><span><strong>PROG*</strong><a href='#index-PROG_002a' class='copiable-anchor'> ¶</a></span></dt> |
| 607 |
<dd><p>Package:LISP |
| 608 |
</p> |
| 609 |
<p>Syntax: |
| 610 |
</p><div class="example"> |
| 611 |
<pre class="example">(prog* ({var | (var [init])}*) {decl}* {tag | statement}*) |
| 612 |
</pre></div> |
| 613 |
|
| 614 |
<p>Creates a NIL block, binds VARs sequentially, and then executes STATEMENTs. |
| 615 |
</p> |
| 616 |
|
| 617 |
</dd></dl> |
| 618 |
|
| •619 |
<dl class="def"> |
| 620 |
<dt id="index-BLOCK"><span class="category">Special Form: </span><span><strong>BLOCK</strong><a href='#index-BLOCK' class='copiable-anchor'> ¶</a></span></dt> |
| 621 |
<dd><p>Package:LISP |
| 622 |
</p> |
| 623 |
<p>Syntax: |
| 624 |
</p><div class="example"> |
| 625 |
<pre class="example">(block name {form}*) |
| 626 |
</pre></div> |
| 627 |
|
| 628 |
<p>The FORMs are evaluated in order, but it is possible to exit the block |
| 629 |
using (RETURN-FROM name value). The RETURN-FROM must be lexically contained |
| 630 |
within the block. |
| 631 |
</p> |
| 632 |
|
| 633 |
</dd></dl> |
| 634 |
|
| •635 |
<dl class="def"> |
| 636 |
<dt id="index-PROGN"><span class="category">Special Form: </span><span><strong>PROGN</strong><a href='#index-PROGN' class='copiable-anchor'> ¶</a></span></dt> |
| 637 |
<dd><p>Package:LISP |
| 638 |
</p> |
| 639 |
<p>Syntax: |
| 640 |
</p><div class="example"> |
| 641 |
<pre class="example">(progn {form}*) |
| 642 |
</pre></div> |
| 643 |
|
| 644 |
<p>Evaluates FORMs in order, and returns whatever the last FORM returns. |
| 645 |
</p> |
| 646 |
|
| 647 |
</dd></dl> |
| 648 |
|
| •649 |
<dl class="def"> |
| 650 |
<dt id="index-APPLY"><span class="category">Function: </span><span><strong>APPLY</strong> <em>(function arg &rest more-args)</em><a href='#index-APPLY' class='copiable-anchor'> ¶</a></span></dt> |
| 651 |
<dd><p>Package:LISP |
| 652 |
</p> |
| 653 |
<p>Applies FUNCTION. The arguments to the function consist of all ARGs |
| 654 |
except for the last, and all elements of the last ARG. |
| 655 |
</p> |
| 656 |
|
| 657 |
</dd></dl> |
| 658 |
|
| •659 |
<dl class="def"> |
| 660 |
<dt id="index-LABELS"><span class="category">Special Form: </span><span><strong>LABELS</strong><a href='#index-LABELS' class='copiable-anchor'> ¶</a></span></dt> |
| 661 |
<dd><p>Package:LISP |
| 662 |
</p> |
| 663 |
<p>Syntax: |
| 664 |
</p><div class="example"> |
| 665 |
<pre class="example">(labels ({(name lambda-list {decl | doc}* {form}*)}*) . body) |
| 666 |
</pre></div> |
| 667 |
|
| 668 |
<p>Evaluates BODY as a PROGN, with the local function definitions in effect. The |
| 669 |
scope of the locally defined functions include the function definitions |
| 670 |
themselves, so their definitions may include recursive references. See the doc |
| 671 |
of DEFUN for the complete syntax of a lambda-list. Doc-strings for local |
| 672 |
functions are simply ignored. |
| 673 |
</p> |
| 674 |
|
| 675 |
</dd></dl> |
| 676 |
|
| •677 |
<dl class="def"> |
| 678 |
<dt id="index-RETURN"><span class="category">Special Form: </span><span><strong>RETURN</strong><a href='#index-RETURN' class='copiable-anchor'> ¶</a></span></dt> |
| 679 |
<dd><p>Package:LISP |
| 680 |
</p> |
| 681 |
<p>Syntax: |
| 682 |
</p><div class="example"> |
| 683 |
<pre class="example">(return [result]) |
| 684 |
</pre></div> |
| 685 |
|
| 686 |
<p>Returns from the lexically surrounding NIL block. The value of RESULT, |
| 687 |
which defaults to NIL, is returned as the value of the block. |
| 688 |
</p> |
| 689 |
|
| 690 |
</dd></dl> |
| 691 |
|
| •692 |
<dl class="def"> |
| 693 |
<dt id="index-TYPECASE"><span class="category">Macro: </span><span><strong>TYPECASE</strong><a href='#index-TYPECASE' class='copiable-anchor'> ¶</a></span></dt> |
| 694 |
<dd><p>Package:LISP |
| 695 |
</p> |
| 696 |
<p>Syntax: |
| 697 |
</p><div class="example"> |
| 698 |
<pre class="example">(typecase keyform {(type {form}*)}*) |
| 699 |
</pre></div> |
| 700 |
|
| 701 |
<p>Evaluates KEYFORM and tries to find the TYPE in which the value of KEYFORM |
| 702 |
belongs. If one is found, then evaluates FORMs that follow the KEY and |
| 703 |
returns the value of the last FORM. If not, simply returns NIL. |
| 704 |
</p> |
| 705 |
|
| 706 |
</dd></dl> |
| 707 |
|
| •708 |
<dl class="def"> |
| 709 |
<dt id="index-AND"><span class="category">Special Form: </span><span><strong>AND</strong><a href='#index-AND' class='copiable-anchor'> ¶</a></span></dt> |
| 710 |
<dd><p>Package:LISP |
| 711 |
</p> |
| 712 |
<p>Syntax: |
| 713 |
</p><div class="example"> |
| 714 |
<pre class="example">(and {form}*) |
| 715 |
</pre></div> |
| 716 |
|
| 717 |
<p>Evaluates FORMs in order from left to right. If any FORM evaluates to NIL, |
| 718 |
returns immediately with the value NIL. Else, returns the value(s) of the |
| 719 |
last FORM. |
| 720 |
</p> |
| 721 |
|
| 722 |
</dd></dl> |
| 723 |
|
| •724 |
<dl class="def"> |
| 725 |
<dt id="index-LET"><span class="category">Special Form: </span><span><strong>LET</strong><a href='#index-LET' class='copiable-anchor'> ¶</a></span></dt> |
| 726 |
<dd><p>Package:LISP |
| 727 |
</p> |
| 728 |
<p>Syntax: |
| 729 |
</p><div class="example"> |
| 730 |
<pre class="example">(let ({var | (var [value])}*) {decl}* {form}*) |
| 731 |
</pre></div> |
| 732 |
|
| 733 |
<p>Initializes VARs, binding them to the values of VALUEs (which defaults to NIL) |
| 734 |
all at once, then evaluates FORMs as a PROGN. |
| 735 |
</p> |
| 736 |
|
| 737 |
</dd></dl> |
| 738 |
|
| •739 |
<dl class="def"> |
| 740 |
<dt id="index-COND"><span class="category">Special Form: </span><span><strong>COND</strong><a href='#index-COND' class='copiable-anchor'> ¶</a></span></dt> |
| 741 |
<dd><p>Package:LISP |
| 742 |
</p> |
| 743 |
<p>Syntax: |
| 744 |
</p><div class="example"> |
| 745 |
<pre class="example">(cond {(test {form}*)}*) |
| 746 |
</pre></div> |
| 747 |
<p>Evaluates each |
| 748 |
TEST in order until one evaluates to a non-NIL value. Then evaluates |
| 749 |
the associated FORMs in order and returns the value(s) of the last |
| 750 |
FORM. If no forms follow the TEST, then returns the value of the |
| 751 |
TEST. Returns NIL, if all TESTs evaluate to NIL. |
| 752 |
</p> |
| 753 |
|
| 754 |
</dd></dl> |
| 755 |
|
| •756 |
<dl class="def"> |
| 757 |
<dt id="index-GET_002dSETF_002dMETHOD_002dMULTIPLE_002dVALUE"><span class="category">Function: </span><span><strong>GET-SETF-METHOD-MULTIPLE-VALUE</strong> <em>(form)</em><a href='#index-GET_002dSETF_002dMETHOD_002dMULTIPLE_002dVALUE' class='copiable-anchor'> ¶</a></span></dt> |
| 758 |
<dd><p>Package:LISP |
| 759 |
Returns the five values (or five ’gangs’) |
| 760 |
constituting the SETF method for FORM. See the doc of |
| 761 |
DEFINE-SETF-METHOD for the meanings of the gangs. The third value |
| 762 |
(i.e., the list of store variables) may consist of any number of |
| 763 |
elements. See the doc of GET-SETF-METHOD for |
| 764 |
comparison. |
| 765 |
</p> |
| 766 |
|
| 767 |
</dd></dl> |
| 768 |
|
| •769 |
<dl class="def"> |
| 770 |
<dt id="index-CATCH"><span class="category">Special Form: </span><span><strong>CATCH</strong><a href='#index-CATCH' class='copiable-anchor'> ¶</a></span></dt> |
| 771 |
<dd><p>Package:LISP |
| 772 |
</p> |
| 773 |
<p>Syntax: |
| 774 |
</p><div class="example"> |
| 775 |
<pre class="example">(catch tag {form}*) |
| 776 |
</pre></div> |
| 777 |
|
| 778 |
<p>Sets up a catcher with |
| 779 |
that value TAG. Then evaluates FORMs as a PROGN, but may possibly |
| 780 |
abort the evaluation by a THROW form that specifies the value EQ to |
| 781 |
the catcher tag. |
| 782 |
</p> |
| 783 |
|
| 784 |
</dd></dl> |
| 785 |
|
| •786 |
<dl class="def"> |
| 787 |
<dt id="index-DEFINE_002dMODIFY_002dMACRO"><span class="category">Macro: </span><span><strong>DEFINE-MODIFY-MACRO</strong><a href='#index-DEFINE_002dMODIFY_002dMACRO' class='copiable-anchor'> ¶</a></span></dt> |
| 788 |
<dd><p>Package:LISP |
| 789 |
</p> |
| 790 |
<p>Syntax: |
| 791 |
</p><div class="example"> |
| 792 |
<pre class="example">(define-modify-macro name lambda-list fun [doc]) |
| 793 |
</pre></div> |
| 794 |
|
| 795 |
<p>Defines a read-modify-write macro, like PUSH and INCF. The defined macro will |
| 796 |
expand a form (NAME place val1 ... valn) into a form that in effect SETFs the |
| 797 |
value of the call (FUN PLACE arg1 ... argm) into PLACE, where arg1 ... argm |
| 798 |
are parameters in LAMBDA-LIST which are bound to the forms VAL1 ... VALn. |
| 799 |
The doc-string DOC, if supplied, is saved as a FUNCTION doc and can be |
| 800 |
retrieved by (documentation ’NAME ’function). |
| 801 |
</p> |
| 802 |
|
| 803 |
</dd></dl> |
| 804 |
|
| •805 |
<dl class="def"> |
| 806 |
<dt id="index-MACROEXPAND_002d1"><span class="category">Function: </span><span><strong>MACROEXPAND-1</strong> <em>(form &optional (env nil))</em><a href='#index-MACROEXPAND_002d1' class='copiable-anchor'> ¶</a></span></dt> |
| 807 |
<dd><p>Package:LISP |
| 808 |
</p> |
| 809 |
<p>If FORM is a macro form, then expands it once. Returns two values: the |
| 810 |
expanded form and a T-or-NIL flag indicating whether the original form was |
| 811 |
a macro. |
| 812 |
</p> |
| 813 |
|
| 814 |
</dd></dl> |
| 815 |
|
| •816 |
<dl class="def"> |
| 817 |
<dt id="index-FUNCALL"><span class="category">Function: </span><span><strong>FUNCALL</strong> <em>(function &rest arguments)</em><a href='#index-FUNCALL' class='copiable-anchor'> ¶</a></span></dt> |
| 818 |
<dd><p>Package:LISP |
| 819 |
</p> |
| 820 |
<p>Applies FUNCTION to the ARGUMENTs |
| 821 |
</p> |
| 822 |
|
| 823 |
</dd></dl> |
| 824 |
|
| •825 |
<dl class="def"> |
| 826 |
<dt id="index-CALL_002dARGUMENTS_002dLIMIT"><span class="category">Constant: </span><span><strong>CALL-ARGUMENTS-LIMIT</strong><a href='#index-CALL_002dARGUMENTS_002dLIMIT' class='copiable-anchor'> ¶</a></span></dt> |
| 827 |
<dd><p>Package:LISP |
| 828 |
The upper exclusive bound on the number of arguments that may be passed to |
| 829 |
a function. Actually, however, there is no such upper bound in GCL. |
| 830 |
</p> |
| 831 |
|
| 832 |
</dd></dl> |
| 833 |
|
| •834 |
<dl class="def"> |
| 835 |
<dt id="index-CASE"><span class="category">Special Form: </span><span><strong>CASE</strong><a href='#index-CASE' class='copiable-anchor'> ¶</a></span></dt> |
| 836 |
<dd><p>Package:LISP |
| 837 |
</p> |
| 838 |
<p>Syntax: |
| 839 |
</p><div class="example"> |
| 840 |
<pre class="example">(case keyform {({key | ({key}*)} {form}*)}*) |
| 841 |
</pre></div> |
| 842 |
|
| 843 |
<p>Evaluates KEYFORM and tries to find the KEY that is EQL to the value of |
| 844 |
KEYFORM. If one is found, then evaluates FORMs that follow the KEY and |
| 845 |
returns the value(s) of the last FORM. If not, simply returns NIL. |
| 846 |
</p> |
| 847 |
|
| 848 |
</dd></dl> |
| 849 |
|
| •850 |
<dl class="def"> |
| 851 |
<dt id="index-DEFINE_002dSETF_002dMETHOD"><span class="category">Macro: </span><span><strong>DEFINE-SETF-METHOD</strong><a href='#index-DEFINE_002dSETF_002dMETHOD' class='copiable-anchor'> ¶</a></span></dt> |
| 852 |
<dd><p>Package:LISP |
| 853 |
</p> |
| 854 |
<p>Syntax: |
| 855 |
</p><div class="example"> |
| 856 |
<pre class="example">(define-setf-method access-fun defmacro-lambda-list {decl | doc}* |
| 857 |
{form}*) |
| 858 |
</pre></div> |
| 859 |
|
| 860 |
<p>Defines how to SETF a generalized-variable reference of the form |
| 861 |
(ACCESS-FUN ...). When a form (setf (ACCESS-FUN arg1 ... argn) value) is |
| 862 |
being evaluated, the FORMs are first evaluated as a PROGN with the parameters |
| 863 |
in DEFMACRO-LAMBDA-LIST bound to ARG1 ... ARGn. Assuming that the last FORM |
| 864 |
returns five values |
| 865 |
(temp-var-1 ... temp-var-k) |
| 866 |
(value-from-1 ... value-form-k) |
| 867 |
(store-var) |
| 868 |
storing-form |
| 869 |
access-form |
| 870 |
in order, the whole SETF is then expanded into |
| 871 |
(let* ((temp-var-1 value-from-1) ... (temp-k value-form-k) |
| 872 |
(store-var VALUE)) |
| 873 |
storing-from) |
| 874 |
Incidentally, the five values are called the five gangs of a SETF method. |
| 875 |
The doc-string DOC, if supplied, is saved as a SETF doc and can be retrieved |
| 876 |
by (documentation ’NAME ’setf). |
| 877 |
</p> |
| 878 |
|
| 879 |
</dd></dl> |
| 880 |
|
| •881 |
<dl class="def"> |
| 882 |
<dt id="index-COMPILER_002dLET"><span class="category">Special Form: </span><span><strong>COMPILER-LET</strong><a href='#index-COMPILER_002dLET' class='copiable-anchor'> ¶</a></span></dt> |
| 883 |
<dd><p>Package:LISP |
| 884 |
</p> |
| 885 |
<p>Syntax: |
| 886 |
</p><div class="example"> |
| 887 |
<pre class="example">(compiler-let ({var | (var [value])}*) {form}*) |
| 888 |
</pre></div> |
| 889 |
|
| 890 |
<p>When interpreted, this form works just like a LET form with all VARs declared |
| 891 |
special. When compiled, FORMs are processed with the VARs bound at compile |
| 892 |
time, but no bindings occur when the compiled code is executed. |
| 893 |
</p> |
| 894 |
|
| 895 |
</dd></dl> |
| 896 |
|
| •897 |
<dl class="def"> |
| 898 |
<dt id="index-VALUES"><span class="category">Function: </span><span><strong>VALUES</strong> <em>(&rest args)</em><a href='#index-VALUES' class='copiable-anchor'> ¶</a></span></dt> |
| 899 |
<dd><p>Package:LISP |
| 900 |
</p> |
| 901 |
<p>Returns ARGs in order, as values. |
| 902 |
</p> |
| 903 |
|
| 904 |
</dd></dl> |
| 905 |
|
| •906 |
<dl class="def"> |
| 907 |
<dt id="index-MULTIPLE_002dVALUE_002dLIST"><span class="category">Special Form: </span><span><strong>MULTIPLE-VALUE-LIST</strong><a href='#index-MULTIPLE_002dVALUE_002dLIST' class='copiable-anchor'> ¶</a></span></dt> |
| 908 |
<dd><p>Package:LISP |
| 909 |
</p> |
| 910 |
<p>Syntax: |
| 911 |
</p><div class="example"> |
| 912 |
<pre class="example">(multiple-value-list form) |
| 913 |
</pre></div> |
| 914 |
|
| 915 |
<p>Evaluates FORM, and returns a list of multiple values it returned. |
| 916 |
</p> |
| 917 |
|
| 918 |
</dd></dl> |
| 919 |
|
| •920 |
<dl class="def"> |
| 921 |
<dt id="index-MULTIPLE_002dVALUE_002dPROG1"><span class="category">Special Form: </span><span><strong>MULTIPLE-VALUE-PROG1</strong><a href='#index-MULTIPLE_002dVALUE_002dPROG1' class='copiable-anchor'> ¶</a></span></dt> |
| 922 |
<dd><p>Package:LISP |
| 923 |
</p> |
| 924 |
<p>Syntax: |
| 925 |
</p><div class="example"> |
| 926 |
<pre class="example">(multiple-value-prog1 form {form}*) |
| 927 |
</pre></div> |
| 928 |
|
| 929 |
<p>Evaluates the first FORM, saves all the values produced, then evaluates |
| 930 |
the other FORMs. Returns the saved values. |
| 931 |
</p> |
| 932 |
|
| 933 |
</dd></dl> |
| 934 |
|
| •935 |
<dl class="def"> |
| 936 |
<dt id="index-MACROLET"><span class="category">Special Form: </span><span><strong>MACROLET</strong><a href='#index-MACROLET' class='copiable-anchor'> ¶</a></span></dt> |
| 937 |
<dd><p>Package:LISP |
| 938 |
</p> |
| 939 |
<p>Syntax: |
| 940 |
</p><div class="example"> |
| 941 |
<pre class="example">(macrolet ({(name defmacro-lambda-list {decl | doc}* . body)}*) |
| 942 |
{form}*) |
| 943 |
</pre></div> |
| 944 |
|
| 945 |
<p>Evaluates FORMs as a PROGN, with the local macro definitions in effect. |
| 946 |
See the doc of DEFMACRO for the complete syntax of a defmacro-lambda-list. |
| 947 |
Doc-strings for local macros are simply ignored. |
| 948 |
</p> |
| 949 |
|
| 950 |
</dd></dl> |
| 951 |
|
| •952 |
<dl class="def"> |
| 953 |
<dt id="index-GO"><span class="category">Special Form: </span><span><strong>GO</strong><a href='#index-GO' class='copiable-anchor'> ¶</a></span></dt> |
| 954 |
<dd><p>Package:LISP |
| 955 |
</p> |
| 956 |
<p>Syntax: |
| 957 |
</p><div class="example"> |
| 958 |
<pre class="example">(go tag) |
| 959 |
</pre></div> |
| 960 |
|
| 961 |
<p>Jumps to the specified TAG established by a lexically surrounding TAGBODY. |
| 962 |
</p> |
| 963 |
|
| 964 |
</dd></dl> |
| 965 |
|
| •966 |
<dl class="def"> |
| 967 |
<dt id="index-PROG"><span class="category">Special Form: </span><span><strong>PROG</strong><a href='#index-PROG' class='copiable-anchor'> ¶</a></span></dt> |
| 968 |
<dd><p>Package:LISP |
| 969 |
</p> |
| 970 |
<p>Syntax: |
| 971 |
</p><div class="example"> |
| 972 |
<pre class="example">(prog ({var | (var [init])}*) {decl}* {tag | statement}*) |
| 973 |
</pre></div> |
| 974 |
|
| 975 |
<p>Creates a NIL block, binds VARs in parallel, and then executes STATEMENTs. |
| 976 |
</p> |
| 977 |
|
| 978 |
</dd></dl> |
| 979 |
|
| •980 |
<dl class="def"> |
| 981 |
<dt id="index-_002aAPPLYHOOK_002a"><span class="category">Variable: </span><span><strong>*APPLYHOOK*</strong><a href='#index-_002aAPPLYHOOK_002a' class='copiable-anchor'> ¶</a></span></dt> |
| 982 |
<dd><p>Package:LISP |
| 983 |
Used to substitute another function for the implicit APPLY normally done |
| 984 |
within EVAL. If *APPLYHOOK* is not NIL, its value must be a function |
| 985 |
which takes three arguments: a function to be applied, a list of arguments, |
| 986 |
and an environment. This function does the application instead of APPLY. |
| 987 |
</p> |
| 988 |
|
| 989 |
</dd></dl> |
| 990 |
|
| •991 |
<dl class="def"> |
| 992 |
<dt id="index-RETURN_002dFROM"><span class="category">Special Form: </span><span><strong>RETURN-FROM</strong><a href='#index-RETURN_002dFROM' class='copiable-anchor'> ¶</a></span></dt> |
| 993 |
<dd><p>Package:LISP |
| 994 |
</p> |
| 995 |
<p>Syntax: |
| 996 |
</p><div class="example"> |
| 997 |
<pre class="example">(return-from name [result]) |
| 998 |
</pre></div> |
| 999 |
|
| 1000 |
<p>Returns from the lexically surrounding block whose name is NAME. The value |
| 1001 |
of RESULT, which defaults to NIL, is returned as the value of the block. |
| 1002 |
</p> |
| 1003 |
|
| 1004 |
</dd></dl> |
| 1005 |
|
| •1006 |
<dl class="def"> |
| 1007 |
<dt id="index-UNLESS"><span class="category">Special Form: </span><span><strong>UNLESS</strong><a href='#index-UNLESS' class='copiable-anchor'> ¶</a></span></dt> |
| 1008 |
<dd><p>Package:LISP |
| 1009 |
</p> |
| 1010 |
<p>Syntax: |
| 1011 |
</p><div class="example"> |
| 1012 |
<pre class="example">(unless test {form}*) |
| 1013 |
</pre></div> |
| 1014 |
|
| 1015 |
<p>If TEST evaluates to NIL, then evaluates FORMs as a PROGN. If not, |
| 1016 |
simply returns NIL. |
| 1017 |
</p> |
| 1018 |
|
| 1019 |
</dd></dl> |
| 1020 |
|
| •1021 |
<dl class="def"> |
| 1022 |
<dt id="index-MULTIPLE_002dVALUE_002dSETQ"><span class="category">Special Form: </span><span><strong>MULTIPLE-VALUE-SETQ</strong><a href='#index-MULTIPLE_002dVALUE_002dSETQ' class='copiable-anchor'> ¶</a></span></dt> |
| 1023 |
<dd><p>Package:LISP |
| 1024 |
</p> |
| 1025 |
<p>Syntax: |
| 1026 |
</p><div class="example"> |
| 1027 |
<pre class="example">(multiple-value-setq variables form) |
| 1028 |
</pre></div> |
| 1029 |
|
| 1030 |
<p>Sets each variable in the list VARIABLES to the corresponding value of FORM. |
| 1031 |
Returns the value assigned to the first variable. |
| 1032 |
</p> |
| 1033 |
|
| 1034 |
</dd></dl> |
| 1035 |
|
| •1036 |
<dl class="def"> |
| 1037 |
<dt id="index-LOCALLY"><span class="category">Special Form: </span><span><strong>LOCALLY</strong><a href='#index-LOCALLY' class='copiable-anchor'> ¶</a></span></dt> |
| 1038 |
<dd><p>Package:LISP |
| 1039 |
</p> |
| 1040 |
<p>Syntax: |
| 1041 |
</p><div class="example"> |
| 1042 |
<pre class="example">(locally {decl}* {form}*) |
| 1043 |
</pre></div> |
| 1044 |
|
| 1045 |
<p>Gives local pervasive declarations. |
| 1046 |
</p> |
| 1047 |
|
| 1048 |
</dd></dl> |
| 1049 |
|
| •1050 |
<dl class="def"> |
| 1051 |
<dt id="index-IDENTITY"><span class="category">Function: </span><span><strong>IDENTITY</strong> <em>(x)</em><a href='#index-IDENTITY' class='copiable-anchor'> ¶</a></span></dt> |
| 1052 |
<dd><p>Package:LISP |
| 1053 |
</p> |
| 1054 |
<p>Simply returns X. |
| 1055 |
</p> |
| 1056 |
|
| 1057 |
</dd></dl> |
| 1058 |
|
| •1059 |
<dl class="def"> |
| 1060 |
<dt id="index-NOT"><span class="category">Function: </span><span><strong>NOT</strong> <em>(x)</em><a href='#index-NOT' class='copiable-anchor'> ¶</a></span></dt> |
| 1061 |
<dd><p>Package:LISP |
| 1062 |
</p> |
| 1063 |
<p>Returns T if X is NIL; NIL otherwise. |
| 1064 |
</p> |
| 1065 |
|
| 1066 |
</dd></dl> |
| 1067 |
|
| •1068 |
<dl class="def"> |
| 1069 |
<dt id="index-DEFCONSTANT"><span class="category">Macro: </span><span><strong>DEFCONSTANT</strong><a href='#index-DEFCONSTANT' class='copiable-anchor'> ¶</a></span></dt> |
| 1070 |
<dd><p>Package:LISP |
| 1071 |
</p> |
| 1072 |
<p>Syntax: |
| 1073 |
</p><div class="example"> |
| 1074 |
<pre class="example">(defconstant name initial-value [doc]) |
| 1075 |
</pre></div> |
| 1076 |
|
| 1077 |
<p>Declares that the variable NAME is a constant whose value is the value of |
| 1078 |
INITIAL-VALUE. The doc-string DOC, if supplied, is saved as a VARIABLE doc |
| 1079 |
and can be retrieved by (documentation ’NAME ’variable). |
| 1080 |
</p> |
| 1081 |
|
| 1082 |
</dd></dl> |
| 1083 |
|
| •1084 |
<dl class="def"> |
| 1085 |
<dt id="index-VALUES_002dLIST"><span class="category">Function: </span><span><strong>VALUES-LIST</strong> <em>(list)</em><a href='#index-VALUES_002dLIST' class='copiable-anchor'> ¶</a></span></dt> |
| 1086 |
<dd><p>Package:LISP |
| 1087 |
</p> |
| 1088 |
<p>Returns all of the elements of LIST in order, as values. |
| 1089 |
</p> |
| 1090 |
|
| 1091 |
</dd></dl> |
| 1092 |
|
| •1093 |
<dl class="def"> |
| 1094 |
<dt id="index-ERROR"><span class="category">Function: </span><span><strong>ERROR</strong> <em>(control-string &rest args)</em><a href='#index-ERROR' class='copiable-anchor'> ¶</a></span></dt> |
| 1095 |
<dd><p>Package:LISP |
| 1096 |
</p> |
| 1097 |
<p>Signals a fatal error. |
| 1098 |
</p> |
| 1099 |
|
| 1100 |
</dd></dl> |
| 1101 |
|
| •1102 |
<dl class="def"> |
| 1103 |
<dt id="index-IF"><span class="category">Special Form: </span><span><strong>IF</strong><a href='#index-IF' class='copiable-anchor'> ¶</a></span></dt> |
| 1104 |
<dd><p>Package:LISP |
| 1105 |
</p> |
| 1106 |
<p>Syntax: |
| 1107 |
</p><div class="example"> |
| 1108 |
<pre class="example">(if test then [else]) |
| 1109 |
</pre></div> |
| 1110 |
|
| 1111 |
<p>If TEST evaluates to non-NIL, then evaluates THEN and returns the result. |
| 1112 |
If not, evaluates ELSE (which defaults to NIL) and returns the result. |
| 1113 |
</p> |
| 1114 |
|
| 1115 |
</dd></dl> |
| 1116 |
|
| •1117 |
<dl class="def"> |
| 1118 |
<dt id="index-UNWIND_002dPROTECT"><span class="category">Special Form: </span><span><strong>UNWIND-PROTECT</strong><a href='#index-UNWIND_002dPROTECT' class='copiable-anchor'> ¶</a></span></dt> |
| 1119 |
<dd><p>Package:LISP |
| 1120 |
</p> |
| 1121 |
<p>Syntax: |
| 1122 |
</p><div class="example"> |
| 1123 |
<pre class="example">(unwind-protect protected-form {cleanup-form}*) |
| 1124 |
</pre></div> |
| 1125 |
|
| 1126 |
<p>Evaluates PROTECTED-FORM and returns whatever it returned. Guarantees that |
| 1127 |
CLEANUP-FORMs be always evaluated before exiting from the UNWIND-PROTECT |
| 1128 |
form. |
| 1129 |
</p> |
| 1130 |
|
| 1131 |
</dd></dl> |
| 1132 |
|
| •1133 |
<dl class="def"> |
| 1134 |
<dt id="index-EVALHOOK"><span class="category">Function: </span><span><strong>EVALHOOK</strong> <em>(form evalhookfn applyhookfn &optional (env nil))</em><a href='#index-EVALHOOK' class='copiable-anchor'> ¶</a></span></dt> |
| 1135 |
<dd><p>Package:LISP |
| 1136 |
</p> |
| 1137 |
<p>Evaluates FORM with *EVALHOOK* bound to EVALHOOKFN and *APPLYHOOK* bound |
| 1138 |
to APPLYHOOKFN. Ignores these hooks once, for the top-level evaluation |
| 1139 |
of FORM. |
| 1140 |
</p> |
| 1141 |
|
| 1142 |
</dd></dl> |
| 1143 |
|
| •1144 |
<dl class="def"> |
| 1145 |
<dt id="index-OR"><span class="category">Special Form: </span><span><strong>OR</strong><a href='#index-OR' class='copiable-anchor'> ¶</a></span></dt> |
| 1146 |
<dd><p>Package:LISP |
| 1147 |
</p> |
| 1148 |
<p>Syntax: |
| 1149 |
</p><div class="example"> |
| 1150 |
<pre class="example">(or {form}*) |
| 1151 |
</pre></div> |
| 1152 |
|
| 1153 |
<p>Evaluates FORMs in order from left to right. If any FORM evaluates to |
| 1154 |
non-NIL, quits and returns that (single) value. If the last FORM is reached, |
| 1155 |
returns whatever values it returns. |
| 1156 |
</p> |
| 1157 |
|
| 1158 |
</dd></dl> |
| 1159 |
|
| •1160 |
<dl class="def"> |
| 1161 |
<dt id="index-CTYPECASE"><span class="category">Macro: </span><span><strong>CTYPECASE</strong><a href='#index-CTYPECASE' class='copiable-anchor'> ¶</a></span></dt> |
| 1162 |
<dd><p>Package:LISP |
| 1163 |
</p> |
| 1164 |
<p>Syntax: |
| 1165 |
</p><div class="example"> |
| 1166 |
<pre class="example">(ctypecase keyplace {(type {form}*)}*) |
| 1167 |
</pre></div> |
| 1168 |
|
| 1169 |
<p>Evaluates KEYPLACE and tries to find the TYPE in which the value of KEYPLACE |
| 1170 |
belongs. If one is found, then evaluates FORMs that follow the KEY and |
| 1171 |
returns the value(s) of the last FORM. If not, signals a correctable error. |
| 1172 |
</p> |
| 1173 |
|
| 1174 |
</dd></dl> |
| 1175 |
|
| •1176 |
<dl class="def"> |
| 1177 |
<dt id="index-EVAL"><span class="category">Function: </span><span><strong>EVAL</strong> <em>(exp)</em><a href='#index-EVAL' class='copiable-anchor'> ¶</a></span></dt> |
| 1178 |
<dd><p>Package:LISP |
| 1179 |
</p> |
| 1180 |
<p>Evaluates EXP and returns the result(s). |
| 1181 |
</p> |
| 1182 |
|
| 1183 |
</dd></dl> |
| 1184 |
|
| •1185 |
<dl class="def"> |
| 1186 |
<dt id="index-PSETF"><span class="category">Macro: </span><span><strong>PSETF</strong><a href='#index-PSETF' class='copiable-anchor'> ¶</a></span></dt> |
| 1187 |
<dd><p>Package:LISP |
| 1188 |
</p> |
| 1189 |
<p>Syntax: |
| 1190 |
</p><div class="example"> |
| 1191 |
<pre class="example">(psetf {place newvalue}*) |
| 1192 |
</pre></div> |
| 1193 |
|
| 1194 |
<p>Similar to SETF, but evaluates all NEWVALUEs first, and then replaces the |
| 1195 |
value in each PLACE with the value of the corresponding NEWVALUE. Returns |
| 1196 |
NIL always. |
| 1197 |
</p> |
| 1198 |
|
| 1199 |
</dd></dl> |
| 1200 |
|
| •1201 |
<dl class="def"> |
| 1202 |
<dt id="index-THROW"><span class="category">Special Form: </span><span><strong>THROW</strong><a href='#index-THROW' class='copiable-anchor'> ¶</a></span></dt> |
| 1203 |
<dd><p>Package:LISP |
| 1204 |
</p> |
| 1205 |
<p>Syntax: |
| 1206 |
</p><div class="example"> |
| 1207 |
<pre class="example">(throw tag result) |
| 1208 |
</pre></div> |
| 1209 |
|
| 1210 |
<p>Evaluates TAG and aborts the execution of the most recent CATCH form that sets |
| 1211 |
up a catcher with the same tag value. The CATCH form returns whatever RESULT |
| 1212 |
returned. |
| 1213 |
</p> |
| 1214 |
|
| 1215 |
</dd></dl> |
| 1216 |
|
| •1217 |
<dl class="def"> |
| 1218 |
<dt id="index-DEFPARAMETER"><span class="category">Macro: </span><span><strong>DEFPARAMETER</strong><a href='#index-DEFPARAMETER' class='copiable-anchor'> ¶</a></span></dt> |
| 1219 |
<dd><p>Package:LISP |
| 1220 |
</p> |
| 1221 |
<p>Syntax: |
| 1222 |
</p><div class="example"> |
| 1223 |
<pre class="example">(defparameter name initial-value [doc]) |
| 1224 |
</pre></div> |
| 1225 |
|
| 1226 |
<p>Declares the variable NAME as a special variable and initializes the value. |
| 1227 |
The doc-string DOC, if supplied, is saved as a VARIABLE doc and can be |
| 1228 |
retrieved by (documentation ’NAME ’variable). |
| 1229 |
</p> |
| 1230 |
|
| 1231 |
</dd></dl> |
| 1232 |
|
| •1233 |
<dl class="def"> |
| 1234 |
<dt id="index-DEFVAR"><span class="category">Macro: </span><span><strong>DEFVAR</strong><a href='#index-DEFVAR' class='copiable-anchor'> ¶</a></span></dt> |
| 1235 |
<dd><p>Package:LISP |
| 1236 |
</p> |
| 1237 |
<p>Syntax: |
| 1238 |
</p><div class="example"> |
| 1239 |
<pre class="example">(defvar name [initial-value [doc]]) |
| 1240 |
</pre></div> |
| 1241 |
|
| 1242 |
<p>Declares the variable NAME as a special variable and, optionally, initializes |
| 1243 |
it. The doc-string DOC, if supplied, is saved as a VARIABLE doc and can be |
| 1244 |
retrieved by (documentation ’NAME ’variable). |
| 1245 |
</p> |
| 1246 |
|
| 1247 |
</dd></dl> |
| 1248 |
|
| •1249 |
</div> |
| 1250 |
<hr> |
| 1251 |
<div class="header"> |
| 1252 |
<p> |
| •1253 |
Next: <a href="Compilation.html">Compilation</a>, Previous: <a href="Streams-and-Reading.html">Streams and Reading</a> [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Function-and-Variable-Index.html" title="Index" rel="index">Index</a>]</p> |
| 1254 |
</div> |
| 1255 |
|
| 1256 |
|
| 1257 |
|
| 1258 |
</body> |
| 1259 |
</html> |