concept-definitions.tex 54 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401
  1. %-*- Mode: TeX -*-
  2. %%Definitions
  3. This section contains notational conventions and definitions of terms
  4. used in this manual.
  5. \beginsubSection{Notational Conventions}\idxtext{notation}
  6. The following notational conventions are used throughout this document.
  7. %========================================
  8. \beginsubsubsection{Font Key}\idxtext{font key}
  9. Fonts are used in this document to convey information.
  10. \beginlist
  11. \itemitem{\term{name}}
  12. Denotes a formal term whose meaning is defined in the Glossary.
  13. When this font is used, the Glossary definition takes precedence
  14. over normal English usage.
  15. Sometimes a glossary term appears subscripted,
  16. as in ``\term{whitespace}\meaning{2}.''
  17. Such a notation selects one particular Glossary definition out of several,
  18. in this case the second.
  19. The subscript notation for Glossary terms is generally used where the
  20. context might be insufficient to disambiguate among the available definitions.
  21. \itemitem{\newterm{name}}
  22. Denotes the introduction of a formal term locally to the current text.
  23. There is still a corresponding glossary entry, and is formally equivalent
  24. to a use of ``\term{name},'' but the hope is that making such uses
  25. conspicuous will save the reader a trip to the glossary in some cases.
  26. \itemitem{\misc{name}}
  27. Denotes a symbol in \thepackage{common-lisp}.
  28. For information about \term{case} conventions,
  29. \seesection\CaseInSymbols.
  30. \itemitem{\f{name}}
  31. Denotes a sample \term{name} or piece of \term{code} that a programmer
  32. might write in \clisp.
  33. This font is also used for certain \term{standardized} names that are not
  34. names of \term{external symbols} of \thepackage{common-lisp},
  35. such as \term{keywords}\meaning{1},
  36. \term{package} \term{names},
  37. and \term{loop keywords}.
  38. \itemitem{\param{name}}
  39. Denotes the name of a \term{parameter} or \term{value}.
  40. In some situations the notation ``\metaparam{name}'' (\ie the same font,
  41. but with surrounding ``angle brackets'') is used instead in order to
  42. provide better visual separation from surrounding characters. These
  43. ``angle brackets'' are metasyntactic, and never actually appear in program
  44. input or output.
  45. \endlist
  46. \endsubsubsection%{Font Key}
  47. %========================================
  48. \beginsubsubsection{Modified BNF Syntax}\idxtext{bnf key}
  49. \DefineSection{ModifiedBNF}
  50. This specification uses an extended Backus Normal Form (BNF) to
  51. describe the syntax of \clisp\ \term{macro forms} and \term{special forms}.
  52. This section discusses the syntax of BNF expressions.
  53. \beginsubsubsubsection{Splicing in Modified BNF Syntax}
  54. The primary extension used is the following:
  55. $$\hbox{\interleave{$O$}}$$
  56. An expression of this form appears whenever a list of elements is
  57. to be spliced into a larger structure and the elements can appear in
  58. any order. The symbol $O$ represents a description of the syntax of
  59. some number of syntactic elements to be spliced; that description must
  60. be of the form
  61. $$O\sub 1\ \vert\ \ldots\ \vert\ O\sub l$$
  62. \issue{LOOP-MISCELLANEOUS-REPAIRS:FIX}
  63. \noindent where each $O\sub i$ can be of the form $S$ or of
  64. the form \star{$S$} or of the form \one{$S$}.
  65. \endissue{LOOP-MISCELLANEOUS-REPAIRS:FIX}
  66. The expression \interleave{$O$} means that a list of the form
  67. $$(O\sub{i\sub 1}\ldots O\sub{i\sub j})\quad 1\leq j$$
  68. \noindent is spliced into the enclosing expression,
  69. such that if $n \neq m$ and $1\leq n,m\leq j$,
  70. then either $O\sub{i\sub n}\neq O\sub{i\sub m}$
  71. or $O\sub{i\sub n} = O\sub{i\sub m} = Q\sub{k}$,
  72. where for some $1\leq k \leq n$, $O\sub{k}$ is of the form \star{$Q\sub{k}$}.
  73. \issue{LOOP-MISCELLANEOUS-REPAIRS:FIX}
  74. %Added to accomodate new LOOP BNF. -kmp 1-May-93
  75. Furthermore, for each $O\sub{i\sub n}$ that is of the form \one{$Q\sub{k}$},
  76. that element is required to appear somewhere in the list to be spliced.
  77. \endissue{LOOP-MISCELLANEOUS-REPAIRS:FIX}
  78. For example, the expression
  79. \f{(x \interleave{A | \star{B} | C} y)}
  80. \noindent means that at most one {\tt A}, any number of {\tt B}'s, and
  81. at most one {\tt C} can occur in any order.
  82. It is a description of any of these:
  83. \code
  84. (x y)
  85. (x B A C y)
  86. (x A B B B B B C y)
  87. (x C B A B B B y)
  88. \endcode
  89. \noindent but not any of these:
  90. \code
  91. (x B B A A C C y)
  92. (x C B C y)
  93. \endcode
  94. \noindent In the first case, both {\tt A} and {\tt C} appear too often,
  95. and in the second case {\tt C} appears too often.
  96. \issue{LOOP-MISCELLANEOUS-REPAIRS:FIX}
  97. % I added this notation to make the LOOP bvl easier to specify. -kmp 29-Apr-93
  98. The notation \plus{\interleave{$O\sub1$ | $O\sub2$ | $\ldots$}}
  99. adds the additional restriction that at least one item from among the possible
  100. choices must be used. For example:
  101. \f{(x \plus{\interleave{A | \star{B} | C}} y)}
  102. \noindent means that at most one {\tt A}, any number of {\tt B}'s, and
  103. at most one {\tt C} can occur in any order, but that in any case at least
  104. one of these options must be selected.
  105. It is a description of any of these:
  106. \code
  107. (x B y)
  108. (x B A C y)
  109. (x A B B B B B C y)
  110. (x C B A B B B y)
  111. \endcode
  112. \noindent but not any of these:
  113. \code
  114. (x y)
  115. (x B B A A C C y)
  116. (x C B C y)
  117. \endcode
  118. \noindent In the first case, no item was used;
  119. in the second case, both {\tt A} and {\tt C} appear too often;
  120. and in the third case {\tt C} appears too often.
  121. Also, the expression:
  122. \f{(x \interleave{\one{A} | \one{B} | C} y)}
  123. \noindent can generate exactly these and no others:
  124. \code
  125. (x A B C y)
  126. (x A C B y)
  127. (x A B y)
  128. (x B A C y)
  129. (x B C A y)
  130. (x B A y)
  131. (x C A B y)
  132. (x C B A y)
  133. \endcode
  134. \endissue{LOOP-MISCELLANEOUS-REPAIRS:FIX}
  135. \endsubsubsubsection%{Splicing in Modified BNF Syntax}
  136. \beginsubsubsubsection{Indirection in Modified BNF Syntax}
  137. An indirection extension is introduced in order to make this
  138. new syntax more readable:
  139. $$\hbox{\down{O}}$$
  140. \noindent If \param{O} is a non-terminal symbol, the right-hand side
  141. of its definition is substituted for the entire expression
  142. \down{O}. For example, the following BNF is equivalent to
  143. the BNF in the previous example:
  144. \f{(x \interleave{\down{O}} y)}
  145. \Vskip 1pc!
  146. \auxbnf{O}{\f{A} | \star{\f{B}} | \f{C}}
  147. \Vskip 1pc!
  148. \endsubsubsubsection%{Indirection in Modified BNF Syntax}
  149. \beginsubsubsubsection{Additional Uses for Indirect Definitions in Modified BNF Syntax}
  150. In some cases, an auxiliary definition in the BNF might appear to be unused
  151. within the BNF, but might still be useful elsewhere. For example, consider the
  152. following definitions:
  153. \DefmacWithValues case
  154. {keyform \stardown{normal-clause} \brac{\down{otherwise-clause}}}
  155. {\starparam{result}}
  156. \DefmacWithValues ccase
  157. {keyplace \stardown{normal-clause}}
  158. {\starparam{result}}
  159. \DefmacWithValues ecase
  160. {keyform \stardown{normal-clause}}
  161. {\starparam{result}}
  162. \auxbnf{normal-clause}{\paren{keys \starparam{form}}}
  163. \auxbnf{otherwise-clause}{\paren{\curly{otherwise | t} \starparam{form}}}
  164. \auxbnf{clause}{normal-clause | otherwise-clause}
  165. \Vskip 1pc!
  166. Here the term ``\param{clause}'' might appear to be ``dead'' in that it
  167. is not used in the BNF. However, the purpose of the BNF is not just to guide parsing,
  168. but also to define useful terms for reference in the descriptive text which follows.
  169. As such, the term ``\param{clause}'' might appear in text that follows,
  170. as shorthand for ``\param{normal-clause} or \param{otherwise-clause}.''
  171. \endsubsubsubsection%{Additional Uses for Indirect Definitions in Modified BNF Syntax}
  172. \endsubsubsection%{Modified BNF Syntax}
  173. %========================================
  174. \beginsubsubsection{Special Symbols}
  175. The special symbols described here are used as a notational convenience
  176. within this document, and are part of neither the \clisp\ language nor
  177. its environment.
  178. \beginlist
  179. \itemitem{\EV}
  180. This indicates evaluation.
  181. For example:
  182. \code
  183. (+ 4 5) \EV 9
  184. \endcode
  185. This means that the result of
  186. evaluating the \term{form} \f{(+ 4 5)} is \f{9}.
  187. %!!! Are the first two of these notations still used? Maybe remove...
  188. If a \term{form} returns \term{multiple values}, those values might
  189. be shown separated by spaces, line breaks, or commas.
  190. For example:
  191. \code
  192. (truncate 7 5)
  193. \EV 1 2
  194. (truncate 7 5)
  195. \EV 1
  196. 2
  197. (truncate 7 5)
  198. \EV 1, 2
  199. \endcode
  200. Each of the above three examples is equivalent, and specifies
  201. that \f{(truncate 7 5)} returns two values, which are \f{1} and \f{2}.
  202. Some \term{conforming implementations} actually type an arrow (or some
  203. other indicator) before showing return values, while others do not.
  204. \itemitem{\OV}
  205. The notation ``{\OV}'' is used to denote one of several possible
  206. alternate results. The example
  207. \code
  208. (char-name #\\a)
  209. \EV NIL
  210. \OV "LOWERCASE-a"
  211. \OV "Small-A"
  212. \OV "LA01"
  213. \endcode
  214. indicates that \nil, \f{"LOWERCASE-a"}, \f{"Small-A"}, \f{"LA01"} are
  215. among the possible results of \f{(char-name \#\\a)}---each with equal preference.
  216. Unless explicitly specified otherwise, it should not be assumed that the set of possible
  217. results shown is exhaustive.
  218. Formally, the above example is equivalent to
  219. \code
  220. (char-name #\\a) \EV \term{implementation-dependent}
  221. \endcode
  222. but it is intended to provide additional information to illustrate some
  223. of the ways in which it is permitted for implementations to diverge.
  224. \itemitem{\NV}
  225. The notation ``{\NV}'' is used to denote a result which is not possible.
  226. This might be used, for example, in order to emphasize a situation where
  227. some anticipated misconception might lead the reader to falsely believe
  228. that the result might be possible. For example,
  229. \code
  230. (function-lambda-expression
  231. (funcall #'(lambda (x) #'(lambda () x)) nil))
  232. \EV NIL, \term{true}, NIL
  233. \OV (LAMBDA () X), \term{true}, NIL
  234. \NV NIL, \term{false}, NIL
  235. \NV (LAMBDA () X), \term{false}, NIL
  236. \endcode
  237. %% 1.2.3 3
  238. \itemitem{\EQ}
  239. This indicates code equivalence. For example:
  240. \code
  241. (gcd x (gcd y z)) \EQ (gcd (gcd x y) z)
  242. \endcode
  243. This means that the results and observable side-effects of evaluating
  244. the \term{form}
  245. \hbox{\f{(gcd x (gcd y z))} } are always the same as the results
  246. and observable side-effects of
  247. \hbox{\f{(gcd (gcd x y) z)} } for any
  248. \f{x}, \f{y}, and \f{z}.
  249. %!!! Need to expand on the definition of observable side-effects.
  250. \itemitem{{\OUT}}
  251. \clisp\ specifies input and output with respect to a non-interactive stream model.
  252. The specific details of how interactive input and output are mapped onto that
  253. non-interactive model are \term{implementation-defined}.
  254. For example, \term{conforming implementations} are permitted to differ in issues
  255. of how interactive input is terminated. For example, \thefunction{read}
  256. terminates when the final delimiter is typed on a non-interactive stream.
  257. In some \term{implementations}, an interactive call to \funref{read} returns
  258. as soon as the final delimiter is typed, even if that delimiter is not a \term{newline}.
  259. In other \term{implementations}, a final \term{newline} is always required.
  260. In still other \term{implementations}, there might be a command which ``activates''
  261. a buffer full of input without the command itself being visible on the program's
  262. input stream.
  263. In the examples in this document, the notation ``{\OUT}'' precedes
  264. lines where interactive input and output occurs. Within such a scenario,
  265. ``\IN{this notation}'' notates user input.
  266. For example, the notation
  267. \code
  268. (+ 1 (print (+ (sqrt (read)) (sqrt (read)))))
  269. \OUT \IN{9 16 }
  270. \OUT 7
  271. \EV 8
  272. \endcode
  273. shows an interaction in which
  274. ``\f{(+ 1 (print (+ (sqrt (read)) (sqrt (read)))))}''
  275. is a \term{form} to be \term{evaluated},
  276. ``\f{9 16 }'' is interactive input,
  277. ``\f{7}'' is interactive output, and
  278. ``\f{8}'' is the \term{value} \term{yielded} from the \term{evaluation}.
  279. The use of this notation is intended to disguise small differences
  280. in interactive input and output behavior between \term{implementations}.
  281. Sometimes, the non-interactive stream model calls for a \term{newline}.
  282. How that \term{newline} character is interactively entered is an
  283. \term{implementation-defined} detail of the user interface, but in that
  284. case, either the notation ``\NewlineChar'' or ``\CRLF'' might be used.
  285. \code
  286. (progn (format t "~&Who? ") (read-line))
  287. \OUT Who? \IN{Fred, Mary, and Sally\CRLF}
  288. \EV "Fred, Mary, and Sally", \term{false}
  289. \endcode
  290. \endlist
  291. \endsubsubsection%{Special Symbols}
  292. %========================================
  293. \beginsubsubsection{Objects with Multiple Notations}
  294. Some \term{objects} in \clisp\ can be notated in more than one way.
  295. In such situations, the choice of which notation to use is technically arbitrary,
  296. but conventions may exist which convey a ``point of view'' or ``sense of intent.''
  297. %----------------------------------------
  298. \beginsubsubsubsection{Case in Symbols}\idxtext{case in symbol names}
  299. \DefineSection{CaseInSymbols}
  300. While \term{case} is significant in the process of \term{interning} a \term{symbol},
  301. the \term{Lisp reader}, by default, attempts to canonicalize the case of a
  302. \term{symbol} prior to interning; \seesection\ReadtableCaseReadEffect.
  303. As such, case in \term{symbols} is not, by default, significant.
  304. Throughout this document, except as explicitly noted otherwise,
  305. the case in which a \term{symbol} appears is not significant;
  306. that is, \f{HELLO}, \f{Hello}, \f{hElLo}, and \f{hello} are
  307. all equivalent ways to denote a symbol whose name is \f{"HELLO"}.
  308. The characters \term{backslash} and \term{vertical-bar} are used to explicitly
  309. quote the \term{case} and other parsing-related
  310. %was "attributes" but now that attributes has formaly meaning,
  311. %not sure if it's too limiting here, so use a general term. -kmp 26-Jan-92
  312. aspects
  313. of characters. As such,
  314. the notations \f{|hello|} and \f{\\h\\e\\l\\l\\o} are equivalent ways
  315. to refer to a symbol whose name is \f{"hello"}, and which is \term{distinct} from
  316. any symbol whose name is \f{"HELLO"}.
  317. The \term{symbols} that correspond to \clisp\ \term{defined names}
  318. have \term{uppercase} names even though their names generally appear
  319. in \term{lowercase} in this document.
  320. \endsubsubsubsection%{Case in Symbols}
  321. %----------------------------------------
  322. \beginsubsubsubsection{Numbers}
  323. %% 1.2.1 1
  324. Although \clisp\ provides a variety of ways for programs to manipulate the
  325. input and output radix for rational numbers, all numbers in this document
  326. are in decimal notation unless explicitly noted otherwise.
  327. \endsubsubsubsection%{Numbers}
  328. %----------------------------------------
  329. \beginsubsubsubsection{Use of the Dot Character}
  330. %% 1.2.5 9
  331. The dot appearing by itself in an \term{expression} such as
  332. \f{(\param{item1} \param{item2} {\dot} \param{tail})}
  333. means that \param{tail} represents a \term{list} of \term{objects}
  334. at the end of a list. For example,
  335. \f{(A B C {\dot} (D E F))}
  336. is notationally equivalent to:
  337. \f{(A B C D E F)}
  338. Although \term{dot} is a valid constituent character in a symbol, no
  339. \term{standardized} \term{symbols} contain the character \term{dot},
  340. so a period that follows a reference to a \term{symbol} at the end of
  341. a sentence in this document should always be interpreted as a period
  342. and never as part of the \term{symbol}'s \term{name}.
  343. For example, within this document, a sentence such as
  344. ``This sample sentence refers to the symbol \funref{car}.''
  345. % confusion about fonts below made more consistent w/previous section
  346. % on symbol names --sjl 13 Mar 1992
  347. %refers to a function named ``\funref{car}'' with three letters in its name,
  348. %and never to a four-letter symbol ``\funref{car.}''
  349. refers to a symbol whose name is \f{"CAR"} (with three letters),
  350. and never to a four-letter symbol \f{"CAR."}
  351. \endsubsubsubsection%{Use of the Dot Character}
  352. %----------------------------------------
  353. \beginsubsubsubsection{NIL}\idxterm{nil}\idxterm{()}\idxref{nil}
  354. \nil\ has a variety of meanings.
  355. It is a \term{symbol} in \thepackage{common-lisp} with the \term{name} \f{"NIL"},
  356. it is \term{boolean} (and \term{generalized boolean}) \term{false},
  357. it is the \term{empty list},
  358. and it is the \term{name} of the \term{empty type} (a \term{subtype} of all \term{types}).
  359. Within \clisp, \nil\ can be notated interchangeably as either \f{NIL} or \f{()}.
  360. By convention, the choice of notation offers a hint as to which of its many
  361. roles it is playing.
  362. \showthree{Notations for NIL}{
  363. \hfil\b{For Evaluation?}&\hfil\b{Notation}\hfil&\b{Typically Implied Role}\cr
  364. \noalign{\vskip 2pt\hrule\vskip 2pt}
  365. Yes&\f{nil}&use as a \term{boolean}.\cr
  366. Yes&\f{'nil}&use as a \term{symbol}.\cr
  367. Yes&\f{'()}&use as an \term{empty list}\cr
  368. No&\f{nil}&use as a \term{symbol} or \term{boolean}.\cr
  369. No&\f{()}&use as an \term{empty list}.\cr
  370. }
  371. Within this document only, \nil\ is also sometimes notated as \term{false} to
  372. emphasize its role as a \term{boolean}.
  373. For example:
  374. \code
  375. (print ()) ;avoided
  376. (defun three nil 3) ;avoided
  377. '(nil nil) ;list of two symbols
  378. '(() ()) ;list of empty lists
  379. (defun three () 3) ;Emphasize empty parameter list.
  380. (append '() '()) \EV () ;Emphasize use of empty lists
  381. (not nil) \EV \term{true} ;Emphasize use as Boolean false
  382. (get 'nil 'color) ;Emphasize use as a symbol
  383. \endcode
  384. A \term{function} is sometimes said to ``be \term{false}'' or ``be \term{true}''
  385. in some circumstance.
  386. Since no \term{function} object can be the same as \nil\
  387. and all \term{function} \term{objects} represent \term{true} when viewed as \term{booleans},
  388. it would be meaningless to say that the \term{function} was literally \term{false}
  389. and uninteresting to say that it was literally \term{true}.
  390. Instead, these phrases are just traditional alternative ways of saying that the
  391. \term{function} ``returns \term{false}'' or ``returns \term{true},'' respectively.
  392. \endsubsubsubsection%{NIL}
  393. \endsubsubsection%{Objects with Multiple Notations}
  394. %========================================
  395. \beginsubsubsection{Designators}
  396. \DefineSection{Designators}
  397. A \newterm{designator} is an \term{object} that denotes another \term{object}.
  398. %!!! RPG: Not clear. Rewrite.
  399. Where a \term{parameter} of an \term{operator} is described as a \term{designator},
  400. the description of the \term{operator} is written in a way that assumes that
  401. the value of the \term{parameter} is the denoted \term{object};
  402. that is, that the \term{parameter} is already of the denoted \term{type}.
  403. (The specific nature of the \term{object} denoted by
  404. a ``\metavar{type} \term{designator}''
  405. or a ``\term{designator} for a \metavar{type}''
  406. can be found in the Glossary entry for ``\metavar{type} \term{designator}.'')
  407. For example, ``\nil'' and ``\thevalueof{*standard-output*}'' are operationally
  408. indistinguishable as \term{stream designators}. Similarly,
  409. the \term{symbol} \f{foo} and the \term{string} \f{"FOO"}
  410. are operationally indistinguishable as \term{string designators}.
  411. Except as otherwise noted, in a situation where the denoted \term{object}
  412. might be used multiple times, it is \term{implementation-dependent}
  413. whether the \term{object} is coerced only once or whether the coercion occurs
  414. each time the \term{object} must be used.
  415. For example, \funref{mapcar} receives a \term{function designator} as an argument,
  416. and its description is written as if this were simply a function. In fact, it
  417. is \term{implementation-dependent} whether the \term{function designator} is
  418. coerced right away or whether it is carried around internally in the form that
  419. it was given as an \term{argument} and re-coerced each time it is needed. In most
  420. cases, \term{conforming programs} cannot detect the distinction, but there are some
  421. pathological situations (particularly those involving self-redefining or
  422. mutually-redefining functions) which do conform and which can detect this difference.
  423. The following program is a \term{conforming program}, but might or might not have
  424. portably correct results, depending on whether its correctness depends on one or
  425. the other of the results:
  426. \code
  427. (defun add-some (x)
  428. (defun add-some (x) (+ x 2))
  429. (+ x 1)) \EV ADD-SOME
  430. (mapcar 'add-some '(1 2 3 4))
  431. \EV (2 3 4 5)
  432. \OV (2 4 5 6)
  433. \endcode
  434. In a few rare situations, there may be a need in a dictionary entry
  435. to refer to the \term{object} that was the original \term{designator}
  436. for a \term{parameter}.
  437. Since naming the \term{parameter} would refer to the denoted \term{object},
  438. the phrase ``the \metavar{parameter-name} \term{designator}''
  439. can be used to refer to the \term{designator} which was the \term{argument}
  440. from which the \term{value} of \metavar{parameter-name} was computed.
  441. \endsubsubsection%{Designators}
  442. %========================================
  443. \beginsubsubsection{Nonsense Words}\idxcode{foo}\idxcode{bar}\idxcode{baz}\idxcode{quux}
  444. When a word having no pre-attached semantics is required (\eg in an
  445. example), it is common in the Lisp community to use one of the words
  446. ``foo,'' ``bar,'' ``baz,'' and ``quux.'' For example, in
  447. \code
  448. (defun foo (x) (+ x 1))
  449. \endcode
  450. the use of the name \f{foo} is just a shorthand way of saying
  451. ``please substitute your favorite name here.''
  452. These nonsense words have gained such prevalance of usage, that it is
  453. commonplace for newcomers to the community to begin to wonder if there
  454. is an attached semantics which they are overlooking---there is not.
  455. \endsubsubsection%{Nonsense Words}
  456. \endsubSection%{Notational Conventions}
  457. %!!! Barmar thinks \secref\InterpretingDictionaryEntries
  458. % should move to someplace around here.
  459. \beginsubSection{Error Terminology}\idxtext{error terminology}
  460. \DefineSection{ErrorTerms}
  461. Situations in which errors might, should, or must be signaled are described
  462. in the standard. The wording used to describe such situations is intended
  463. to have precise meaning. The following list is a glossary of those meanings.
  464. \beginlist
  465. \itemitem{\b{Safe code}}\idxterm{safe}
  466. This is \term{code} processed with the \declref{safety} optimization
  467. at its highest setting (\f{3}). \declref{safety} is a lexical property
  468. of code. The phrase ``the function \f{F} should signal an error''
  469. means that if \f{F} is invoked from code processed with the highest
  470. \declref{safety} optimization, an error is signaled.
  471. It is \term{implementation-dependent} whether \f{F} or the calling
  472. code signals the error.
  473. \itemitem{\b{Unsafe code}}\idxterm{unsafe}
  474. This is code processed with lower safety levels.
  475. Unsafe code might do error checking. Implementations are permitted to
  476. treat all code as safe code all the time.
  477. %% 1.2.4 6
  478. %% 1.2.4 9
  479. %% 1.2.4 10
  480. \itemitem{\b{An error is signaled}}%
  481. \idxterm{signal}\idxtext{is signaled}\idxtext{must signal}
  482. This means that an error is signaled in both safe and unsafe code.
  483. \term{Conforming code} may rely on the fact that the error is signaled
  484. in both safe and unsafe code. Every implementation is required to
  485. detect the error in both safe and unsafe code. For example, ``an error
  486. is signaled if \funref{unexport} is given a \term{symbol}
  487. not \term{accessible} in the \term{current package}.''
  488. If an explicit error type is not specified, the default is \typeref{error}.
  489. \itemitem{\b{An error should be signaled}}%
  490. \idxterm{signal}\idxtext{should signal}
  491. This means that an error is signaled in safe code, and an error
  492. might be signaled in unsafe code. \term{Conforming code} may rely on the
  493. fact that the error is signaled in safe code. Every
  494. implementation is required to detect the error at least in safe code.
  495. When the error is not signaled, the ``consequences are undefined''
  496. (see below). For example, ``\funref{+} should signal an error \oftype{type-error}
  497. if any argument is not \oftype{number}.''
  498. \itemitem{\b{Should be prepared to signal an error}}%
  499. \idxterm{signal}\idxtext{prepared to signal}
  500. This is similar to ``should be signaled'' except that it does not
  501. imply that `extra effort' has to be taken on the part of an \term{operator}
  502. to discover an erroneous situation if the normal action of that \term{operator}
  503. can be performed successfully with only `lazy' checking.
  504. An \term{implementation} is always permitted to signal an error,
  505. but even in \term{safe} \term{code}, it is only required to signal the error
  506. when failing to signal it might lead to incorrect results.
  507. In \term{unsafe} \term{code}, the consequences are undefined.
  508. For example, defining that
  509. ``\funref{find} should be prepared to signal an error \oftype{type-error}
  510. if its second \term{argument} is not a \term{proper list}''
  511. does not imply that an error is always signaled. The \term{form}
  512. \code
  513. (find 'a '(a b . c))
  514. \endcode
  515. must either signal an error \oftype{type-error} in \term{safe} \term{code},
  516. else return \f{A}.
  517. In \term{unsafe} \term{code}, the consequences are undefined.
  518. By contrast,
  519. \code
  520. (find 'd '(a b . c))
  521. \endcode
  522. must signal an error \oftype{type-error} in \term{safe} \term{code}.
  523. In \term{unsafe} \term{code}, the consequences are undefined.
  524. Also,
  525. \code
  526. (find 'd '#1=(a b . #1#))
  527. \endcode
  528. in \term{safe code}
  529. might return \nil\ (as an \term{implementation-defined} extension),
  530. might never return,
  531. or might signal an error \oftype{type-error}.
  532. In \term{unsafe} \term{code}, the consequences are undefined.
  533. Typically, the ``should be prepared to signal'' terminology is used in
  534. type checking situations where there are efficiency considerations that
  535. make it impractical to detect errors that are not relevant to the
  536. correct operation of the \term{operator}.
  537. \itemitem{\b{The consequences are unspecified}}%
  538. \idxtext{consequences}\idxtext{unspecified consequences}
  539. This means that the consequences are unpredictable but harmless.
  540. Implementations are permitted to specify the consequences of this
  541. situation. No \term{conforming code} may depend on the results or effects of
  542. this situation, and all \term{conforming code} is required to treat the
  543. results and effects of this situation as unpredictable but harmless.
  544. For example, ``if the second argument to \funref{shared-initialize}
  545. specifies a name that does not correspond to any \term{slots}
  546. \term{accessible} in the \term{object}, the results are unspecified.''
  547. %% 1.2.4 4
  548. \itemitem{\b{The consequences are undefined}}%
  549. \idxtext{consequences}\idxtext{undefined consequences}
  550. This means that the consequences are unpredictable. The consequences
  551. may range from harmless to fatal. No \term{conforming code} may depend on
  552. the results or effects. \term{Conforming code} must treat the consequences as
  553. unpredictable. In places where the words ``must,'' ``must not,'' or
  554. ``may not'' are used, then ``the consequences are undefined'' if the
  555. stated requirement is not met and no specific consequence is
  556. explicitly stated. An implementation is permitted to signal an error
  557. in this case.
  558. For example: ``Once a name has been declared by \macref{defconstant}
  559. to be constant, any further assignment or binding of that
  560. variable has undefined consequences.''
  561. \itemitem{\b{An error might be signaled}}%
  562. \idxterm{signal}\idxtext{might signal}
  563. This means that the situation has undefined consequences;
  564. however, if an error is signaled, it is of the specified \term{type}.
  565. For example, ``\funref{open} might signal an error \oftype{file-error}.''
  566. \itemitem{\b{The return values are unspecified}}%
  567. \idxtext{unspecified values}
  568. This means that only the number and nature of the return values of a
  569. \term{form} are not specified. However, the issue of whether or not
  570. any side-effects or transfer of control occurs is still well-specified.
  571. A program can be well-specified even if it uses a function whose
  572. returns values are unspecified. For example, even if the return
  573. values of some function \f{F} are unspecified, an expression such as
  574. \f{(length (list (F)))} is still well-specified because it does not
  575. rely on any particular aspect of the value or values returned by \f{F}.
  576. \itemitem{\b{Implementations may be extended to cover this situation}}%
  577. \idxtext{extensions}
  578. This means that the \term{situation} has undefined consequences;
  579. however, a \term{conforming implementation} is free to treat
  580. the situation in a more specific way.
  581. For example, an \term{implementation} might define
  582. that an error is signaled,
  583. or that an error should be signaled,
  584. or even that a certain well-defined non-error behavior occurs.
  585. %% 1.2.4 5
  586. No \term{conforming code} may depend on the consequences of such a \term{situation};
  587. all \term{conforming code} must treat the consequences of the situation
  588. as undefined. \term{Implementations} are required to document how the
  589. situation is treated.
  590. For example, ``implementations may be extended to define other type
  591. specifiers to have a corresponding \term{class}.''
  592. \itemitem{\b{Implementations are free to extend the syntax}}%
  593. \idxtext{extensions}
  594. This means that in this situation implementations are permitted to
  595. define unambiguous extensions to the syntax of the \term{form} being
  596. described. No \term{conforming code} may depend on this extension.
  597. Implementations are required to document each such extension. All
  598. \term{conforming code} is required to treat the syntax as meaningless. The
  599. standard might disallow certain extensions while allowing others. For
  600. example, ``no implementation is free to extend the syntax of
  601. \macref{defclass}.''
  602. \issue{ERROR-TERMINOLOGY-WARNING:MIGHT}
  603. \itemitem{\b{A warning might be issued}}%
  604. \idxtext{warning}
  605. This means that \term{implementations} are encouraged to issue a warning
  606. if the context is appropriate (\eg when compiling). However, a
  607. \term{conforming implementation} is not required to issue a warning.
  608. \endissue{ERROR-TERMINOLOGY-WARNING:MIGHT}
  609. % This means that a warning might be issued, as described in \funref{warn},
  610. % in both safe and unsafe code when the situation is detected.
  611. % \term{Conforming code} can rely on the fact that a warning will be issued in
  612. % both safe and unsafe code when the situation is detected. Every
  613. % implementation is required to detect this situation in both safe and
  614. % unsafe code when the situation is detected. The presence of a warning
  615. % will in no way alter the value returned by the \term{form} that
  616. % caused the situation to occur. For example, ``a warning is issued if a
  617. % declaration specifier is not one of those defined in the description
  618. % of \misc{declare} and has not been declared in a \declref{declaration}
  619. % declaration.''
  620. %
  621. % \itemitem{\b{A warning should be issued}}
  622. %
  623. % This means that a warning might be issued. \term{Conforming code} must not
  624. % rely on the fact that a warning will be issued. If the situation is
  625. % detected, a warning might be issued. The presence of a warning will
  626. % in no way alter the value returned by the \term{form} that caused the
  627. % situation to occur. For example, ``a warning should be issued if a
  628. % variable declared \declref{ignore} is ever referenced or is also declared
  629. % \declref{special}, or if a variable is lexical, never referenced, and not
  630. % declared \declref{ignore}.''
  631. \endlist
  632. \endsubSection%{Error Terminology}
  633. \beginsubsection{Sections Not Formally Part Of This Standard}
  634. \DefineSection{RemovableText}
  635. %% A lot of this seems to be just rationale. Does it really need to
  636. %% be included here? --sjl 13 Mar 92
  637. Front matter and back matter, such as the ``Table of Contents,''
  638. ``Index,'' ``Figures,'' ``Credits,'' and ``Appendix'' are not considered formally
  639. part of this standard, so that we retain the flexibility needed to update
  640. these sections even at the last minute without fear of needing a formal
  641. vote to change those parts of the document. These items are quite short
  642. and very useful, however, and it is not recommended that they be removed
  643. even in an abridged version of this document.
  644. Within the concept sections, subsections whose names begin with
  645. the words ``Note'' or ``Notes'' or ``Example'' or ``Examples''
  646. are provided for illustration purposes only, and are not considered
  647. part of the standard.
  648. An attempt has been made to place these sections last in their parent section,
  649. so that they could be removed without disturbing the contiguous numbering of the
  650. surrounding sections in order to produce a document of smaller size.
  651. Likewise, the ``Examples'' and ``Notes'' sections in a dictionary entry
  652. are not considered part of the standard and could be removed if necessary.
  653. Nevertheless, the examples provide important clarifications and consistency
  654. checks for the rest of the material, and such abridging is not recommended
  655. unless absolutely unavoidable.
  656. \endsubsection%{Sections Not Formally Part Of This Standard}
  657. \beginsubSection{Interpreting Dictionary Entries}
  658. \DefineSection{InterpretingDictionaryEntries}
  659. The dictionary entry for each \term{defined name} is partitioned into
  660. sections. Except as explicitly indicated otherwise below, each section
  661. is introduced by a label identifying that section. The omission of a
  662. section implies that the section is either not applicable, or would
  663. provide no interesting information.
  664. This section defines the significance of each potential section in a
  665. dictionary entry.
  666. \beginsubsubsection{The ``Affected By'' Section of a Dictionary Entry}
  667. For an \term{operator}, anything that can affect the side effects of
  668. or \term{values} returned by the \term{operator}.
  669. For a \term{variable}, anything that can affect the \term{value} of the \term{variable}
  670. including \term{functions} that bind or assign it.
  671. \endsubsubsection%{The ``Affected By'' Section of a Dictionary Entry}
  672. \beginsubsubsection{The ``Arguments'' Section of a Dictionary Entry}
  673. This information describes the syntax information of entries such as those for
  674. \term{declarations} and special \term{expressions} which are never \term{evaluated}
  675. as \term{forms}, and so do not return \term{values}.
  676. \endsubsubsection%{The ``Arguments'' Section of a Dictionary Entry}
  677. \beginsubsubsection{The ``Arguments and Values'' Section of a Dictionary Entry}
  678. An English language description of what \term{arguments} the \term{operator} accepts
  679. and what \term{values} it returns, including information about defaults for \term{parameters}
  680. corresponding to omittable \term{arguments}
  681. (such as \term{optional parameters} and \term{keyword parameters}).
  682. For \term{special operators} and \term{macros},
  683. their \term{arguments} are not \term{evaluated} unless it is explicitly stated in their
  684. descriptions that they are \term{evaluated}.
  685. %% I added the first part of this sentence as editorial discretion
  686. %% since I believe we strongly feel that this is not specified otherwise,
  687. %% but we want to avoid an unexpected conflict in case it is. -kmp 9-May-94
  688. Except as explicitly specified otherwise,
  689. %% Added per X3J13 at May 4-5, 1994 meeting. -kmp 9-May-94
  690. the consequences are undefined if these type restrictions are violated.
  691. \endsubsubsection%{The ``Arguments and Values'' Section of a Dictionary Entry}
  692. \beginsubsubsection{The ``Binding Types Affected'' Section of a Dictionary Entry}
  693. This information alerts the reader to the kinds of \term{bindings} that might
  694. potentially be affected by a declaration. Whether in fact any particular such
  695. \term{binding} is actually affected is dependent on additional factors as well.
  696. See the ``Description'' section of the declaration in question for details.
  697. \endsubsubsection%{The ``Binding Types Affected'' Section of a Dictionary Entry}
  698. \beginsubsubsection{The ``Class Precedence List'' Section of a Dictionary Entry}
  699. This appears in the dictionary entry for a \term{class},
  700. and contains an ordered list of the \term{classes} defined
  701. by \clisp\ that must be in the \term{class precedence list} of this \term{class}.
  702. It is permissible for other (\term{implementation-defined}) \term{classes}
  703. to appear in the \term{implementation}'s \term{class precedence list} for the \term{class}.
  704. It is permissible for
  705. either \typeref{standard-object}
  706. or \typeref{structure-object}
  707. to appear in the \term{implementation}'s \term{class precedence list};
  708. for details, \seesection\TypeRelationships.
  709. Except as explicitly indicated otherwise somewhere in this specification,
  710. no additional \term{standardized} \term{classes} may appear in
  711. the \term{implementation}'s \term{class precedence list}.
  712. By definition of the relationship between \term{classes} and \term{types},
  713. the \term{classes} listed in this section are also \term{supertypes} of
  714. the \term{type} denoted by the \term{class}.
  715. \endsubsubsection%{The ``Class Precedence List'' Section of a Dictionary Entry}
  716. \beginsubsubsection{Dictionary Entries for Type Specifiers}
  717. \DefineSection{TypeSpecEntries}
  718. The \term{atomic type specifiers} are those \term{defined names}
  719. listed in \figref\StandardizedAtomicTypeSpecs.
  720. Such dictionary entries are of kind
  721. ``Class,'' ``Condition Type,'' ``System Class,'' or ``Type.''
  722. A description of how to interpret
  723. a \term{symbol} naming one of these \term{types} or \term{classes}
  724. as an \term{atomic type specifier}
  725. is found in the ``Description'' section of such dictionary entries.
  726. The \term{compound type specifiers} are those \term{defined names}
  727. listed in \figref\StandardizedCompoundTypeSpecNames.
  728. Such dictionary entries are of kind ``Class,'' ``System Class,''
  729. ``Type,'' or ``Type Specifier.''
  730. A description of how to interpret as a \term{compound type specifier}
  731. a \term{list} whose \term{car} is such a \term{symbol}
  732. is found in the
  733. ``Compound Type Specifier Kind,''
  734. ``Compound Type Specifier Syntax,''
  735. ``Compound Type Specifier Arguments,''
  736. and ``Compound Type Specifier Description''
  737. sections of such dictionary entries.
  738. \beginsubsubsubsection{The ``Compound Type Specifier Kind'' Section of a Dictionary Entry}
  739. An ``abbreviating'' \term{type specifier} is one that describes a \term{subtype}
  740. for which it is in principle possible to enumerate the \term{elements},
  741. but for which in practice it is impractical to do so.
  742. A ``specializing'' \term{type specifier} is one that describes a \term{subtype}
  743. by restricting the \term{type} of one or more components of the \term{type},
  744. such as \term{element type} or \term{complex part type}.
  745. A ``predicating'' \term{type specifier} is one that describes a \term{subtype}
  746. containing only those \term{objects} that satisfy a given \term{predicate}.
  747. A ``combining'' \term{type specifier} is one that describes a \term{subtype}
  748. in a compositional way, using combining operations (such as ``and,'' ``or,'' and
  749. ``not'') on other \term{types}.
  750. \endsubsubsubsection%{The ``Compound Type Specifier Kind'' Section of a Dictionary Entry}
  751. \beginsubsubsubsection{The ``Compound Type Specifier Syntax'' Section of a Dictionary Entry}
  752. This information about a \term{type} describes the syntax of a
  753. \term{compound type specifier} for that \term{type}.
  754. Whether or not the \term{type} is acceptable as an \term{atomic type specifier}
  755. is not represented here; \seesection\TypeSpecEntries.
  756. \endsubsubsubsection%{The ``Compound Type Specifier Syntax'' Section of a Dictionary Entry}
  757. \beginsubsubsubsection{The ``Compound Type Specifier Arguments'' Section of a Dictionary Entry}
  758. This information describes \term{type} information for the structures defined in
  759. the ``Compound Type Specifier Syntax'' section.
  760. \endsubsubsubsection%{The ``Compound Type Specifier Arguments'' Section of a Dictionary Entry}
  761. \beginsubsubsubsection{The ``Compound Type Specifier Description'' Section of a Dictionary Entry}
  762. This information describes the meaning of the structures defined in
  763. the ``Compound Type Specifier Syntax'' section.
  764. \endsubsubsubsection%{The ``Compound Type Specifier Description'' Section of a Dictionary Entry}
  765. \endsubsubsection%{Dictionary Entries for Type Specifiers}
  766. \beginsubsubsection{The ``Constant Value'' Section of a Dictionary Entry}
  767. This information describes the unchanging \term{type} and \term{value} of
  768. a \term{constant variable}.
  769. \endsubsubsection%{The ``Constant Value'' Section of a Dictionary Entry}
  770. \beginsubsubsection{The ``Description'' Section of a Dictionary Entry}
  771. A summary of the \term{operator} and all intended aspects of the \term{operator},
  772. but does not necessarily include all the fields referenced below it
  773. (``Side Effects,'' ``Exceptional Situations,'' \etc.)
  774. \endsubsubsection%{The ``Description'' Section of a Dictionary Entry}
  775. \beginsubsubsection{The ``Examples'' Section of a Dictionary Entry}
  776. Examples of use of the \term{operator}.
  777. These examples are not considered part of the standard;
  778. \seesection\RemovableText.
  779. \endsubsubsection%{The ``Examples'' Section of a Dictionary Entry}
  780. \beginsubsubsection{The ``Exceptional Situations'' Section of a Dictionary Entry}
  781. Three kinds of information may appear here:
  782. \beginlist
  783. \item{\bull}
  784. Situations that are detected by the \term{function} and formally signaled.
  785. \item{\bull}
  786. Situations that are handled by the \term{function}.
  787. \item{\bull}
  788. Situations that may be detected by the \term{function}.
  789. \endlist
  790. This field does not include conditions that could
  791. be signaled by \term{functions} passed to and called by this \term{operator}
  792. as arguments or through dynamic variables, nor by executing subforms of this
  793. operator if it is a \term{macro} or \term{special operator}.
  794. \endsubsubsection%{The ``Exceptional Situations'' Section of a Dictionary Entry}
  795. \beginsubsubsection{The ``Initial Value'' Section of a Dictionary Entry}
  796. This information describes the initial \term{value} of a \term{dynamic variable}.
  797. Since this variable might change, see \term{type} restrictions in the ``Value Type'' section.
  798. \endsubsubsection%{The ``Initial Value'' Section of a Dictionary Entry}
  799. \issue{DOCUMENTATION-FUNCTION-TANGLED:REQUIRE-ARGUMENT}
  800. \beginsubsubsection{The ``Argument Precedence Order'' Section of a Dictionary Entry}
  801. %% Added italic font for "argument precedence order" per Boyer/Kaufmann/Moore #3.
  802. %% -kmp 9-May-94
  803. This information describes the \term{argument precedence order}.
  804. If it is omitted, the \term{argument precedence order} is the default (left to right).
  805. \endsubsubsection%{The ``Argument Precedence Order'' Section of a Dictionary Entry}
  806. \endissue{DOCUMENTATION-FUNCTION-TANGLED:REQUIRE-ARGUMENT}
  807. \beginsubsubsection{The ``Method Signature'' Section of a Dictionary Entry}
  808. The description of a \term{generic function} includes descriptions of the
  809. \term{methods} that are defined on that \term{generic function} by the standard.
  810. A method signature is used to describe the \term{parameters} and
  811. \term{parameter specializers} for each \term{method}.
  812. \term{Methods} defined for the \term{generic function} must be of the form described
  813. by the \term{method} \term{signature}.
  814. \Defmeth {F} {\paren{\param{x} \param{class}}
  815. \paren{\param{y} t}
  816. {\opt} \param{z} {\key} \param{k}}
  817. \noindent This \term{signature} indicates that this method on the \term{generic function}
  818. \b{F} has two \term{required parameters}:
  819. \param{x}, which must be a \term{generalized instance} of the \term{class} \param{class};
  820. and \param{y}, which can be any \term{object}
  821. (\ie a \term{generalized instance} of the \term{class} \typeref{t}).
  822. In addition, there is an \term{optional parameter} \param{z} and a
  823. \term{keyword parameter} \param{k}. This \term{signature} also indicates that this
  824. method on \f{F} is a \term{primary method} and has no \term{qualifiers}.
  825. For each \term{parameter}, the \term{argument} supplied must be in the
  826. intersection of the \term{type} specified in the description of the
  827. corresponding \term{generic function} and the \term{type} given in
  828. the \term{signature} of some \term{method} (including not only those
  829. \term{methods} defined in this specification, but also
  830. \term{implementation-defined} or user-defined \term{methods} in situations
  831. where the definition of such \term{methods} is permitted).
  832. \endsubsubsection%{The ``Method Signature'' Section of a Dictionary Entry}
  833. \beginsubsubsection{The ``Name'' Section of a Dictionary Entry}
  834. This section introduces the dictionary entry. It is not explicitly labeled.
  835. It appears preceded and followed by a horizontal bar.
  836. In large print at left, the \term{defined name} appears; if more than one
  837. \term{defined name} is to be described by the entry, all such \term{names}
  838. are shown separated by commas.
  839. In somewhat smaller italic print at right is an indication of what kind
  840. of dictionary entry this is. Possible values are:
  841. % This list believed correct as of 23-Oct-91 -kmp
  842. \beginlist
  843. \itemitem{\i{Accessor}}
  844. This is an \term{accessor} \term{function}.
  845. \itemitem{\i{Class}}
  846. This is a \term{class}.
  847. \itemitem{\i{Condition Type}}
  848. This is a \subtypeof{condition}.
  849. % We don't need to constrain how implementations define condition types.
  850. % --sjl 13 Mar 92
  851. %\term{Condition types} are defined with
  852. %\macref{define-condition}, not \macref{defclass}.
  853. \itemitem{\i{Constant Variable}}
  854. This is a \term{constant variable}.
  855. \itemitem{\i{Declaration}}
  856. This is a \term{declaration identifier}.
  857. \itemitem{\i{Function}}
  858. This is a \term{function}.
  859. \itemitem{\i{Local Function}}
  860. This is a \term{function} that is defined only lexically within the scope of some
  861. other \term{macro form}.
  862. \itemitem{\i{Local Macro}}
  863. This is a \term{macro} that is defined only lexically within the scope of some
  864. other \term{macro form}.
  865. \itemitem{\i{Macro}}
  866. This is a \term{macro}.
  867. \itemitem{\i{Restart}}
  868. This is a \term{restart}.
  869. \itemitem{\i{Special Operator}}
  870. This is a \term{special operator}.
  871. \itemitem{\i{Standard Generic Function}}
  872. This is a \term{standard generic function}.
  873. \itemitem{\i{Symbol}}
  874. This is a \term{symbol} that is specially recognized in some particular situation,
  875. such as the syntax of a \term{macro}.
  876. \itemitem{\i{System Class}}
  877. This is like \term{class}, but it identifies a \term{class} that is potentially
  878. a \term{built-in class}. (No \term{class} is actually required to be a
  879. \term{built-in class}.)
  880. \itemitem{\i{Type}}
  881. This is an \term{atomic type specifier},
  882. and depending on information for each particular entry,
  883. may subject to form other \term{type specifiers}.
  884. \itemitem{\i{Type Specifier}}
  885. This is a \term{defined name} that is not an \term{atomic type specifier},
  886. but that can be used in constructing valid \term{type specifiers}.
  887. \itemitem{\i{Variable}}
  888. This is a \term{dynamic variable}.
  889. \endlist
  890. \endsubsubsection%{The ``Name'' Section of a Dictionary Entry}
  891. \beginsubsubsection{The ``Notes'' Section of a Dictionary Entry}
  892. Information not found elsewhere in this description
  893. which pertains to this \term{operator}.
  894. Among other things, this might include
  895. cross reference information,
  896. code equivalences,
  897. stylistic hints,
  898. implementation hints,
  899. typical uses.
  900. This information is not considered part of the standard;
  901. any \term{conforming implementation} or \term{conforming program}
  902. is permitted to ignore the presence of this information.
  903. \endsubsubsection%{The ``Notes'' Section of a Dictionary Entry}
  904. \beginsubsubsection{The ``Pronunciation'' Section of a Dictionary Entry}
  905. This offers a suggested pronunciation for \term{defined names}
  906. so that people not in verbal communication with the original designers
  907. can figure out how to pronounce words that are not in normal English usage.
  908. This information is advisory only, and is not considered part of the standard.
  909. % Added for Ida, who wondered why these didn't occur for every entry.
  910. For brevity, it is only provided for entries with names that are specific to
  911. \clisp\ and would not be found in {\WebstersDictionary}.
  912. \endsubsubsection%{The ``Pronunciation'' Section of a Dictionary Entry}
  913. \beginsubsubsection{The ``See Also'' Section of a Dictionary Entry}
  914. List of references to other parts of this standard
  915. that offer information relevant to this \term{operator}.
  916. This list is not part of the standard.
  917. \endsubsubsection%{The ``See Also'' Section of a Dictionary Entry}
  918. \beginsubsubsection{The ``Side Effects'' Section of a Dictionary Entry}
  919. Anything that is changed as a result of the
  920. evaluation of the \term{form} containing this \term{operator}.
  921. \endsubsubsection%{The ``Side Effects'' Section of a Dictionary Entry}
  922. \beginsubsubsection{The ``Supertypes'' Section of a Dictionary Entry}
  923. This appears in the dictionary entry for a \term{type},
  924. and contains a list of the \term{standardized} \term{types}
  925. that must be \term{supertypes} of this \term{type}.
  926. %!!! Is this needed? Mail sent to `barmar' and `barrett' with subject "supertypes"
  927. % asking for opinions. -kmp 10-Feb-92
  928. In \term{implementations} where there is a corresponding \term{class},
  929. the order of the \term{classes} in the \term{class precedence list}
  930. is consistent with the order presented in this section.
  931. \endsubsubsection%{The ``Supertypes'' Section of a Dictionary Entry}
  932. \beginsubsubsection{The ``Syntax'' Section of a Dictionary Entry}
  933. This section describes how to use the \term{defined name} in code.
  934. The ``Syntax'' description for a \term{generic function}
  935. describes the \term{lambda list} of the \term{generic function} itself,
  936. while the ``Method Signatures'' describe the \term{lambda lists}
  937. of the defined \term{methods}.
  938. The ``Syntax'' description for
  939. an \term{ordinary function},
  940. a \term{macro},
  941. or a \term{special operator}
  942. describes its \term{parameters}.
  943. For example, an \term{operator} description might say:
  944. \Defun {F} {x y {\opt} z {\key} k}
  945. \noindent This description indicates that the function \b{F}
  946. has two required parameters, \param{x} and \param{y}. In addition,
  947. there is an optional parameter \param{z} and a keyword parameter \param{k}.
  948. For \term{macros} and \term{special operators}, syntax is given
  949. in modified BNF notation; \seesection\ModifiedBNF.
  950. For \term{functions} a \term{lambda list} is given.
  951. %Added per Barmar:
  952. In both cases, however, the outermost parentheses are omitted,
  953. and default value information is omitted.
  954. \beginsubsubsubsection{Special ``Syntax'' Notations for Overloaded Operators}
  955. %RPG: Nice idea.
  956. If two descriptions exist for the same operation but with different numbers of
  957. arguments, then the extra arguments are to be treated as optional. For example,
  958. this pair of lines:
  959. \DefunWithValues file-position {stream} {position}
  960. \DefunWithValues file-position {stream position-spec} {success-p}
  961. \noindent is operationally equivalent to this line:
  962. \DefunWithValues file-position {stream {\opt} position-spec} {result}
  963. \noindent and differs only in that it provides on opportunity to introduce different
  964. names for \term{parameter} and \term{values} for each case.
  965. The separated (multi-line) notation is used when an \term{operator} is overloaded in
  966. such a way that the \term{parameters} are used in different ways
  967. depending on how many \term{arguments} are supplied (\eg for \thefunction{/})
  968. or the return values are different in the two cases (\eg for \thefunction{file-position}).
  969. \endsubsubsubsection%{Special ``Syntax'' Notations for Overloaded Operators}
  970. \beginsubsubsubsection{Naming Conventions for Rest Parameters}
  971. Within this specification,
  972. if the name of a \term{rest parameter} is chosen to be a plural noun,
  973. use of that name in \param{parameter} font refers
  974. to the \term{list} to which the \term{rest parameter} is bound.
  975. Use of the singular form of that name in \param{parameter} font refers
  976. to an \term{element} of that \term{list}.
  977. For example, given a syntax description such as:
  978. \Defun {F} {{\rest} \param{arguments}}
  979. \noindent it is appropriate to refer either to the \term{rest parameter} named
  980. \param{arguments} by name, or to one of its elements by speaking of ``an \param{argument},''
  981. ``some \param{argument},'' ``each \param{argument}'' \etc.
  982. \endsubsubsubsection%{Naming Conventions for Rest Parameters}
  983. \beginsubsubsubsection{Requiring Non-Null Rest Parameters in the ``Syntax'' Section}
  984. In some cases it is useful to refer to all arguments equally as a single
  985. aggregation using a \term{rest parameter} while at the same time
  986. requiring at least one argument. A variety of imperative and
  987. declarative means are available in \term{code} for expressing such a
  988. restriction, however they generally do not manifest themselves in a
  989. \term{lambda list}. For descriptive purposes within this specification,
  990. \Defun {F} {{\rest} \plus{arguments}}
  991. \noindent means the same as
  992. \Defun {F} {{\rest} arguments}
  993. \noindent but introduces the additional requirement that there be
  994. at least one \param{argument}.
  995. \endsubsubsubsection%{Requiring Non-Null Rest Parameters in the ``Syntax'' Section}
  996. \beginsubsubsubsection{Return values in the ``Syntax'' Section}
  997. An evaluation arrow ``{\EV}'' precedes a list of \term{values} to be returned.
  998. For example:
  999. \DefunWithValues {F} {a b c} {x}
  1000. \noindent indicates that \f{F} is an operator that has three \term{required parameters}
  1001. (\ie \param{a}, \param{b}, and \param{c}) and that returns one \term{value} (\ie \param{x}).
  1002. If more than one \term{value} is returned by an operator, the \term{names} of the
  1003. \term{values} are separated by commas, as in:
  1004. \DefunWithValues {F} {a b c} {x, y, z}
  1005. \beginsubsubsubsubsection{No Arguments or Values in the ``Syntax'' Section}
  1006. If no \term{arguments} are permitted, or no \term{values} are returned,
  1007. a special notation is used to make this more visually apparent. For example,
  1008. \DefunWithValues {F} {\noargs} {\novalues}
  1009. indicates that \f{F} is an operator that accepts no \term{arguments} and returns
  1010. no \term{values}.
  1011. \endsubsubsubsubsection%{No Arguments or Values in the ``Syntax'' Section}
  1012. \beginsubsubsubsubsection{Unconditional Transfer of Control in the ``Syntax'' Section}
  1013. Some \term{operators} perform an unconditional transfer of control, and
  1014. so never have any return values. Such \term{operators} are notated using
  1015. a notation such as the following:
  1016. \DefunNoReturn F {a b c}
  1017. \endsubsubsubsubsection%{Unconditional Transfer of Control in the ``Syntax'' Section}
  1018. \endsubsubsubsection%{Return values in the ``Syntax'' Section}
  1019. \endsubsubsection%{The ``Syntax'' Section of a Dictionary Entry}
  1020. \beginsubsubsection{The ``Valid Context'' Section of a Dictionary Entry}
  1021. This information is used by dictionary entries such as ``Declarations''
  1022. in order to restrict the context in which the declaration may appear.
  1023. A given ``Declaration'' might appear in
  1024. a \term{declaration} (\ie a \misc{declare} \term{expression}),
  1025. a \term{proclamation} (\ie a \macref{declaim} or \funref{proclaim} \term{form}),
  1026. or both.
  1027. \endsubsubsection%{The ``Valid Context'' Section of a Dictionary Entry}
  1028. \beginsubsubsection{The ``Value Type'' Section of a Dictionary Entry}
  1029. This information describes any \term{type} restrictions on a \term{dynamic variable}.
  1030. %% I added the first part of this sentence as editorial discretion
  1031. %% since I believe we strongly feel that this is not specified otherwise,
  1032. %% but we want to avoid an unexpected conflict in case it is. -kmp 9-May-94
  1033. Except as explicitly specified otherwise,
  1034. %% Added per X3J13 at May 4-5, 1994 meeting. -kmp 9-May-94
  1035. the consequences are undefined if this type restriction is violated.
  1036. \endsubsubsection%{The ``Value Type'' Section of a Dictionary Entry}
  1037. \endsubSection%{Interpreting Dictionary Entries}