sl.doc 87 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884
  1. UCP-60 January 1978
  2. First Revision - August 1978
  3. STANDARD LISP REPORT
  4. J. B. Marti
  5. A. C. Hearn
  6. M. L. Griss
  7. C. Griss
  8. University of Utah
  9. Salt Lake City, UT 84112
  10. UUCS-78-101
  11. ABSTRACT: A description of Standard LISP primitive
  12. data structures and functions is presented.
  13. Work supported in part by the National Science Foundation under Grant
  14. No. MCS76-15035 and by the Burroughs Corporation.
  15. Standard LISP Report. 1
  16. 1. Introduction.
  17. 1. Introduction.
  18. Although the programming language LISP was first formulated in
  19. 1960 [6], a widely accepted standard has never appeared. As a result,
  20. various dialects of LISP have been produced [4-12], in some cases
  21. several on the same machine! Consequently, a user often faces
  22. considerable difficulty in moving programs from one system to
  23. another. In addition, it is difficult to write and use programs which
  24. depend on the structure of the source code such as translators,
  25. editors and cross-reference programs.
  26. In 1969, a model for such a standard was produced [2] as part of
  27. a general effort to make a large LISP based algebraic manipulation
  28. program, REDUCE [3], as portable as possible. The goal of this work
  29. was to define a uniform subset of LISP 1.5 and its variants so that
  30. programs written in this subset could run on any reasonable LISP
  31. system.
  32. In the intervening years, two deficiencies in the approach taken
  33. in Ref. [2] have emerged. First in order to be as general as
  34. possible, the specific semantics and values of several key functions
  35. were left undefined. Consequently, programs built on this subset
  36. could not make any assumptions about the form of the values of such
  37. functions. The second deficiency related to the proposed method of
  38. implementation of this language. The model considered in effect two
  39. versions of LISP on any given machine, namely Standard LISP and the
  40. LISP of the host machine (which we shall refer to as Target LISP).
  41. This meant that if any definition was stored in interpretive form, it
  42. would vary from implementation to implementation, and consequently
  43. one could not write programs in Standard LISP which needed to assume
  44. any knowledge about the structure of such forms. This deficiency
  45. became apparent during recent work on the development of a portable
  46. compiler for LISP [1]. Clearly a compiler has to know precisely the
  47. structure of its source code; we concluded that the appropriate
  48. source was Standard LISP and not Target LISP.
  49. With these thoughts in mind we decided to attempt again a
  50. definition of Standard LISP. However, our approach this time is more
  51. aggressive. In this document we define a standard for a reasonably
  52. large subset of LISP with as precise as possible a statement about
  53. the semantics of each function. Secondly, we now require that the
  54. target machine interpreter be modified or written to support this
  55. standard, rather than mapping Standard LISP onto Target LISP as
  56. previously.
  57. We have spent countless hours in discussion over many of the
  58. definitions given in this report. We have also drawn on the help and
  59. advice of a lot of friends whose names are given in the
  60. Acknowledgements. Wherever possible, we have used the definition of a
  61. function as given in the LISP 1.5 Programmer's Manual [6] and have
  62. only deviated where we felt it desirable in the light of LISP
  63. programming experience since that time. In particular, we have given
  64. Standard LISP Report. 2
  65. 1. Introduction.
  66. considerable thought to the question of variable bindings and the
  67. definition of the evaluator functions EVAL and APPLY. We have also
  68. abandoned the previous definition of LISP arrays in favor of the more
  69. accepted idea of a vector which most modern LISP systems support.
  70. These are the places where we have strayed furthest from the
  71. conventional definitions, but we feel that the consistency which
  72. results from our approach is worth the redefinition.
  73. We have avoided entirely in this report problems which arise
  74. from environment passing, such as those represented by the FUNARG
  75. problem. We do not necessarily exclude these considerations from our
  76. standard, but in this report have decided to avoid the controversy
  77. which they create. The semantic differences between compiled and
  78. interpreted functions is the topic of another paper [1]. Only
  79. functions which affect the compiler in a general way make reference
  80. to it.
  81. This document is not intended as an introduction to LISP rather
  82. it is assumed that the reader is already familiar with some version.
  83. The document is thus intended as an arbiter of the syntax and
  84. semantics of Standard LISP. However, since it is not intended as an
  85. implementation description, we deliberately leave unspecified many of
  86. the details on which an actual implementation depends. For example,
  87. while we assume the existence of a symbol table for atoms (the
  88. "object list" in LISP terminology), we do not specify its structure,
  89. since conventional LISP programming does not require this
  90. information. Our ultimate goal, however, is to remedy this by
  91. defining an interpreter for Standard LISP which is sufficiently
  92. complete that its implementation on any given computer will be
  93. straightforward and precise. At that time, we shall produce an
  94. implementation level specification for Standard LISP which will
  95. extend the description of the primitive functions defined herein by
  96. introducing a new set of lower level primitive functions in which the
  97. structure of the symbol table, heap and so on may be defined.
  98. The plan of this paper is as follows. In Section 2 we describe
  99. the various data types used in Standard LISP. In Section 3, a
  100. description of all Standard LISP functions is presented, organized by
  101. type. These functions are defined in an ALGOL-like syntax which is
  102. easier to read than LISP S-expressions. Section 4 describes global
  103. variables which control the operation of Standard LISP. For
  104. completeness, a formal translation of the extended syntax to Standard
  105. LISP is given in Appendix A. In Appendix B is an alphabetical list of
  106. all defined LISP functions and their arguments and types for easy
  107. reference. A complete index of all functions and concepts concludes
  108. the report.
  109. Standard LISP Report. 3
  110. 2. Preliminaries.
  111. 2.1 Primitive Data Types.
  112. integer - Integers are also called "fixed" numbers. The magnitude of
  113. an integer is unrestricted. Integers in the LISP input stream are
  114. recognized by the grammar:
  115. <digit> ::= 0|1|2|3|4|5|6|7|8|9
  116. <unsigned-integer> ::= <digit>|<unsigned-integer><digit>
  117. <integer> ::= <unsigned-integer> |
  118. +<unsigned-integer> |
  119. -<unsigned-integer>
  120. floating - Any floating point number. The precision of floating point
  121. numbers is determined solely by the implementation. In BNF
  122. floating point numbers are recognized by the grammar:
  123. <base> ::= <unsigned-integer>.|.<unsigned-integer>|
  124. <unsigned-integer>.<unsigned-integer>
  125. <unsigned-floating> ::= <base>|
  126. <base>E<unsigned-integer>|
  127. <base>E-<unsigned-integer>|
  128. <base>E+<unsigned-integer>
  129. <floating> ::= <unsigned-floating>|
  130. +<unsigned-floating>|-<unsigned-floating>
  131. id - An identifier is a string of characters which may have the
  132. following items associated with it.
  133. print name - The characters of the identifier.
  134. flags - An identifier may be tagged with a flag. Access is by the
  135. FLAG, REMFLAG, and FLAGP functions defined in the "Property
  136. List Functions" section.
  137. properties - An identifier may have an indicator-value pair
  138. associated with it. Access is by the PUT, GET, and REMPROP
  139. functions defined in the "Property List Functions" section.
  140. values/functions - An identifier may have a value associated with
  141. it. Access to values is by SET and SETQ defined in the
  142. "Variables and Bindings" section. The method by which the value
  143. is attached to the identifier is known as the binding type,
  144. being one of LOCAL, GLOBAL, or FLUID. Access to the binding
  145. type is by the GLOBAL, GLOBALP, FLUID, FLUIDP, and UNFLUID
  146. functions.
  147. An identifier may have a function or macro associated with
  148. it. Access is by the PUTD, GETD, and REMD functions defined in
  149. the "Function Definition" section. An identifier may not have
  150. both a function and a value associated with it.
  151. OBLIST entry - An identifier may be entered and removed from a
  152. Standard LISP Report. 4
  153. 2. Preliminaries.
  154. structure called the OBLIST. Its presence on the OBLIST does
  155. not directly affect the other properties. Access to the OBLIST
  156. is by INTERN, REMOB, and READ defined in the "Identifiers" and
  157. "Input and Output" sections.
  158. The maximum length of a Standard LISP identifier is 24 characters
  159. (excluding occurrences of the escape character !) but an
  160. implementation may allow more. Special characters (digits in the
  161. first position and punctuation) must be prefixed with an escape
  162. character, an ! in Standard LISP. In BNF identifiers are
  163. recognized by the grammar:
  164. <special-character> ::= !<any-character>
  165. <alphabetic> ::=
  166. A|B|C|D|E|F|G|H|I|J|K|L|M|N|O|P|Q|R|S|T|U|V|W|X|Y|Z|
  167. a|b|c|d|e|f|g|h|i|j|k|l|m|n|o|p|q|r|s|t|u|v|w|x|y|z
  168. <lead-character> ::= <special-character>|<alphabetic>
  169. <regular-character> ::= <lead-character>|<digit>
  170. <last-part> ::= <regular-character>|
  171. <last-part><regular-character>
  172. <id> ::= <lead-character>|<lead-character><last-part>
  173. Note: Using lower case letters in identifiers may cause
  174. portability problems. Lower case letters are automatically
  175. converted to upper case when the !*RAISE flag is T. See the
  176. "System GLOBAL Variables" section.
  177. string - A set of characters enclosed in double quotes as in "THIS IS
  178. A STRING". A quote is included by doubling it as in "HE SAID,
  179. ""LISP""". The maximum size of strings is 80 characters but an
  180. implementation may allow more. Strings are not part of the OBLIST
  181. and are considered constants like numbers, vectors, and
  182. function-pointers.
  183. dotted-pair - A primitive structure which has a left and right part.
  184. A notation called dot-notation is used for dotted pairs and takes
  185. the form:
  186. (<left-part> . <right-part>)
  187. The <left-part> is known as the CAR portion and the <right-part>
  188. as the CDR portion. The left and right parts may be of any type.
  189. Spaces are used to resolve ambiguity with floating point numbers.
  190. vector - A primitive uniform structure in which an integer index is
  191. used to access random values in the structure. The individual
  192. elements of a vector may be of any type. Access to vectors is
  193. restricted to functions defined in the "Vectors" section. A
  194. notation for vectors, vector-notation, has the elements of a
  195. vector separated by commas and surrounded by square brackets.
  196. Standard LISP Report. 5
  197. 2. Preliminaries.
  198. <elements> ::= <any>|<any>, <elements>
  199. <vector> ::= [<elements>]
  200. function-pointer - An implementation may have functions which deal
  201. with specific data types other than those listed. The use of these
  202. entities is to be avoided with the exception of a restricted use
  203. of the function-pointer, an access method to compiled EXPRs and
  204. FEXPRs. A particular function-pointer must remain valid throughout
  205. execution. Systems which change the location of a function must
  206. use either an indirect reference or change all occurrences of the
  207. associated value. There are two classes of use of
  208. function-pointers, those which are supported by Standard LISP but
  209. are not well defined, and those which are well defined.
  210. Not well defined - Function pointers may be displayed by the print
  211. functions or expanded by EXPLODE. The value appears in the
  212. convention of the implementation site. The value is not defined
  213. in Standard LISP. Function pointers may be created by COMPRESS
  214. in the format used for printing but the value used is not
  215. defined in Standard LISP. Function pointers may be created by
  216. functions which deal with compiled function loading. Again, the
  217. values created are not well defined in Standard LISP.
  218. Well defined - The function pointer associated with a EXPR or
  219. FEXPR may be retrieved by GETD and is valid as long as Standard
  220. LISP is in execution. Function pointers may be stored using
  221. PUTD, PUT, SETQ and the like or by being bound to variables.
  222. Function pointers may be checked for equivalence by EQ. The
  223. value may be checked for being a function pointer by the CODEP
  224. function.
  225. 2.2 Classes of Primitive Data Types.
  226. The classes of primitive types are a notational convenience for
  227. describing the properties of functions.
  228. boolean - The set of global variables {T,NIL}, or their respective
  229. values, {T, NIL}. (see the "System GLOBAL Variables" section).
  230. extra-boolean - Any value in the system. Anything that is not NIL has
  231. the boolean interpretation T.
  232. ftype - The class of definable function types. The set of ids {EXPR,
  233. FEXPR, MACRO}.
  234. number - The set of {integer, floating}.
  235. Standard LISP Report. 6
  236. 2. Preliminaries.
  237. constant - The set of {integer, floating, string, vector,
  238. function-pointer}. Constants evaluate to themselves (see the
  239. definition of EVAL in "The Interpreter" section).
  240. any - The set of {integer, floating, string, id, dotted-pair, vector,
  241. function-pointer}. An S-expression is another term for any. All
  242. Standard LISP entities have some value unless an ERROR occurs
  243. during evaluation.
  244. atom - The set {any}-{dotted-pair}.
  245. 2.3 Structures.
  246. Structures are entities created out of the primitive types by
  247. the use of dotted-pairs. Lists are structures very commonly required
  248. as actual parameters to functions. Where a list of homogeneous
  249. entities is required by a function this class will be denoted by
  250. xxx-list where xxx is the name of a class of primitives or
  251. structures. Thus a list of ids is an id-list, a list of integers an
  252. integer-list and so on.
  253. list - A list is recursively defined as NIL or the dotted-pair (any .
  254. list). A special notation called list-notation is used to
  255. represent lists. List-notation eliminates extra parentheses and
  256. dots. The list (a . (b . (c . NIL))) in list notation is (a b c).
  257. List-notation and dot-notation may be mixed as in (a b . c) or (a
  258. (b . c) d) which are (a . (b . c)) and (a . ((b . c) . (d .
  259. NIL))). In BNF lists are recognized by the grammar:
  260. <left-part> ::= ( | <left-part> <any>
  261. <list> ::= <left-part>) | <left-part> . <any>)
  262. Note: () is an alternate input representation of NIL.
  263. alist - An association list; each element of the list is a
  264. dotted-pair, the CAR part being a key associated with the value in
  265. the CDR part.
  266. cond-form - A cond-form is a list of 2 element lists of the form:
  267. (ANTECEDENT:any CONSEQUENT:any)
  268. The first element will henceforth be known as the antecedent and
  269. the second as the consequent. The antecedent must have a value.
  270. The consequent may have a value or an occurrence of GO or RETURN
  271. as described in the "Program Feature Functions" section.
  272. Standard LISP Report. 7
  273. 2. Preliminaries.
  274. lambda - A LAMBDA expression which must have the form (in list
  275. notation): (LAMBDA parameters body). "parameters" is a list of
  276. formal parameters for "body" an S-expression to be evaluated. The
  277. semantics of the evaluation are defined with the EVAL function
  278. (see "The Interpreter" section).
  279. function - A LAMBDA expression or a function-pointer to a function. A
  280. function is always evaluated as an EVAL, SPREAD form.
  281. 2.4 Function Descriptions.
  282. Each function is provided with a prototypical header line. Each
  283. formal parameter is given a name and suffixed with its allowed type.
  284. Lower case tokens are names of classes and upper case tokens are
  285. parameter names referred to in the definition. The type of the value
  286. returned by the function (if any) is suffixed to the parameter list.
  287. If it is not commonly used the parameter type may be a specific set
  288. enclosed in brackets {...}. For example:
  289. PUTD(FNAME:id, TYPE:ftype, BODY:{lambda, function-pointer}):id
  290. PUTD is a function with three parameters. The parameter FNAME is an
  291. id to be the name of the function being defined. TYPE is the type of
  292. the function being defined and BODY is a lambda expression or a
  293. function-pointer. PUTD returns the name of the function being
  294. defined.
  295. Functions which accept formal parameter lists of arbitrary
  296. length have the type class and parameter enclosed in square brackets
  297. indicating that zero or more occurrences of that argument are
  298. permitted. For example:
  299. AND([U:any]):extra-boolean
  300. AND is a function which accepts zero or more arguments which may be
  301. of any type.
  302. 2.5 Function Types.
  303. EVAL type functions are those which are invoked with evaluated
  304. arguments. NOEVAL functions are invoked with unevaluated arguments.
  305. SPREAD type functions have their arguments passed in one-to-one
  306. correspondence with their formal parameters. NOSPREAD functions
  307. receive their arguments as a single list. EVAL, SPREAD functions are
  308. associated with EXPRs and NOEVAL, NOSPREAD functions with FEXPRs.
  309. EVAL, NOSPREAD and NOEVAL, SPREAD functions can be simulated using
  310. NOEVAL, NOSPREAD functions or MACROs.
  311. Standard LISP Report. 8
  312. 2. Preliminaries.
  313. EVAL, SPREAD type functions may have a maximum of 15 parameters.
  314. There is no limit on the number of parameters a NOEVAL, NOSPREAD
  315. function or MACRO may have.
  316. In the context of the description of an EVAL, SPREAD function,
  317. when we speak of the formal parameters we mean their actual values.
  318. However, in a NOEVAL, NOSPREAD function it is the unevaluated actual
  319. parameters.
  320. A third function type, the MACRO, implements functions which
  321. create S-expressions based on actual parameters. When a macro
  322. invocation is encountered, the body of the macro, a lambda
  323. expression, is invoked as a NOEVAL, NOSPREAD function with the
  324. macro's invocation bound as a list to the macros single formal
  325. parameter. When the macro has been evaluated the resulting
  326. S-expression is reevaluated. The description of the EVAL and EXPAND
  327. functions provide precise details.
  328. 2.6 The Extended Syntax.
  329. Functions that may be conveniently defined in Standard LISP
  330. appear in a subset of the REDUCE syntax [3] which we believe is
  331. easier to read than Standard LISP. A formal translation scheme for
  332. the extended syntax to Standard LISP is presented in Appendix A. The
  333. definitions supplied are not intended as a rigorous implementation
  334. guide but rather as a precise definition of the function's semantics.
  335. 2.7 Error and Warning Messages.
  336. Many functions detect errors. The description of such functions
  337. will include these error conditions and suggested formats for display
  338. of the generated error messages. A call on the ERROR function is
  339. implied but the error number is not specified by Standard LISP. In
  340. some cases a warning message is sufficient. To distinguish between
  341. errors and warnings, errors are prefixed with five asterisks and
  342. warnings with only three.
  343. Primitive functions check arguments that must be of a certain
  344. primitive type for being of that type and display an error message if
  345. the argument is not correct. The type mismatch error always takes the
  346. form:
  347. ***** PARAMETER not TYPE for FN
  348. Here PARAMETER is the unacceptable actual parameter, TYPE is the type
  349. that PARAMETER was supposed to be. FN is the name of the function
  350. that detected the error.
  351. Standard LISP Report. 9
  352. 3.1 Elementary Predicates.
  353. 3.1 Elementary Predicates.
  354. Functions in this section return T when the condition defined is
  355. met and NIL when it is not. Defined are type checking functions and
  356. elementary comparisons.
  357. ATOM(U:any):boolean
  358. Type: EVAL, SPREAD
  359. Returns T if U is not a pair.
  360. EXPR PROCEDURE ATOM(U);
  361. NULL PAIRP U;
  362. CODEP(U:any):boolean
  363. TYPE: EVAL, SPREAD.
  364. Returns T if U is a function-pointer.
  365. CONSTANTP(U:any):boolean
  366. Type: EVAL, SPREAD
  367. Returns T if U is a constant (a number, string, function-pointer, or
  368. vector).
  369. EXPR PROCEDURE CONSTANTP(U);
  370. NULL OR(PAIRP U, IDP U);
  371. EQ(U:any, V:any):boolean
  372. Type: EVAL, SPREAD
  373. Returns T if U points to the same object as V. EQ is not a reliable
  374. comparison between numeric arguments.
  375. EQN(U:any, V:any):boolean
  376. Type: EVAL, SPREAD
  377. Returns T if U and V are EQ or if U and V are numbers and have the
  378. same value and type.
  379. EQUAL(U:any, V:any):boolean
  380. Type: EVAL, SPREAD
  381. Returns T if U and V are the same. Dotted-pairs are compared
  382. recursively to the bottom levels of their trees. Vectors must have
  383. identical dimensions and EQUAL values in all positions. Strings must
  384. have identical characters. Function pointers must have EQ values.
  385. Other atoms must be EQN equal.
  386. Standard LISP Report. 10
  387. 3.1 Elementary Predicates.
  388. FIXP(U:any):boolean
  389. Type: EVAL, SPREAD
  390. Returns T if U is an integer (a fixed number).
  391. FLOATP(U:any):boolean
  392. Type: EVAL, SPREAD
  393. Returns T if U is a floating point number.
  394. IDP(U:any):boolean
  395. Type: EVAL, SPREAD
  396. Returns T if U is an id.
  397. NULL(U:any):boolean
  398. Type: EVAL, SPREAD
  399. Returns T if U is NIL.
  400. EXPR PROCEDURE NULL(U);
  401. U EQ NIL;
  402. NUMBERP(U:any):boolean
  403. Type: EVAL, SPREAD
  404. Returns T if U is a number (integer or floating).
  405. EXPR PROCEDURE NUMBERP(U);
  406. IF OR(FIXP U, FLOATP U) THEN T ELSE NIL;
  407. PAIRP(U:any):boolean
  408. Type: EVAL, SPREAD
  409. Returns T if U is a dotted-pair.
  410. STRINGP(U:any):boolean
  411. Type: EVAL, SPREAD
  412. Returns T if U is a string.
  413. VECTORP(U:any):boolean
  414. Type: EVAL, SPREAD
  415. Returns T if U is a vector.
  416. Standard LISP Report. 11
  417. 3.2 Functions on Dotted-Pairs.
  418. 3.2 Functions on Dotted-Pairs.
  419. The following are elementary functions on dotted-pairs. All
  420. functions in this section which require dotted-pairs as parameters
  421. detect a type mismatch error if the actual parameter is not a
  422. dotted-pair.
  423. CAR(U:dotted-pair):any
  424. Type: EVAL, SPREAD
  425. CAR(CONS a b) ==> a. The left part of U is returned. The type
  426. mismatch error occurs if U is not a dotted-pair.
  427. CDR(U:dotted-pair):any
  428. Type: EVAL, SPREAD
  429. CDR(CONS a b) ==> b. The right part of U is returned. The type
  430. mismatch error occurs if U is not a dotted-pair.
  431. The composites of CAR and CDR are supported up to 4 levels, namely:
  432. CAAAAR CAAAR CAAR
  433. CAAADR CAADR CADR
  434. CAADAR CADAR CDAR
  435. CAADDR CADDR CDDR
  436. CADAAR CDAAR
  437. CADADR CDADR
  438. CADDAR CDDAR
  439. CADDDR CDDDR
  440. CDAAAR
  441. CDAADR
  442. CDADAR
  443. CDADDR
  444. CDDAAR
  445. CDDADR
  446. CDDDAR
  447. CDDDDR
  448. CONS(U:any, V:any):dotted-pair
  449. Type: EVAL, SPREAD
  450. Returns a dotted-pair which is not EQ to anything and has U as its
  451. CAR part and V as its CDR part.
  452. LIST([U:any]):list
  453. Type: NOEVAL, NOSPREAD, or MACRO
  454. A list of the evaluation of each element of U is returned.
  455. FEXPR PROCEDURE LIST(U);
  456. EVLIS U;
  457. Standard LISP Report. 12
  458. 3.2 Functions on Dotted-Pairs.
  459. RPLACA(U:dotted-pair, V:any):dotted-pair
  460. Type: EVAL, SPREAD
  461. The CAR portion of the dotted-pair U is replaced by V. If dotted-pair
  462. U is (a . b) then (V . b) is returned. The type mismatch error occurs
  463. if U is not a dotted-pair.
  464. RPLACD(U:dotted-pair, V:any):dotted-pair
  465. Type: EVAL, SPREAD
  466. The CDR portion of the dotted-pair U is replaced by V. If dotted-pair
  467. U is (a . b) then (a . V) is returned. The type mismatch error occurs
  468. if U is not a dotted-pair.
  469. 3.3 Identifiers.
  470. The following functions deal with identifiers and the OBLIST,
  471. the structure of which is not defined. The function of the OBLIST is
  472. to provide a symbol table for identifiers created during input.
  473. Identifiers created by READ which have the same characters will
  474. therefore refer to the same object (see the EQ function in the
  475. "Elementary Predicates" section).
  476. COMPRESS(U:id-list):{atom}-{vector}
  477. Type: EVAL, SPREAD
  478. U is a list of single character identifiers which is built into a
  479. Standard LISP entity and returned. Recognized are numbers, strings,
  480. and identifiers with the escape character prefixing special
  481. characters. The formats of these items appear in the "Primitive Data
  482. Types" section. Identifiers are not interned on the OBLIST. Function
  483. pointers may be compressed but this is an undefined use. If an entity
  484. cannot be parsed out of U or characters are left over after parsing
  485. an error occurs:
  486. ***** Poorly formed atom in COMPRESS
  487. EXPLODE(U:{atom}-{vector}):id-list
  488. Type: EVAL, SPREAD
  489. Returned is a list of interned characters representing the characters
  490. to print of the value of U. The primitive data types have these
  491. formats:
  492. integer - Leading zeroes are suppressed and a minus sign prefixes
  493. the digits if the integer is negative.
  494. floating - The value appears in the format [-]0.nn...nnE[-]mm if
  495. the magnitude of the number is too large or small to display in
  496. [-]nnnn.nnnn format. The crossover point is determined by the
  497. implementation.
  498. Standard LISP Report. 13
  499. 3.3 Identifiers.
  500. id - The characters of the print name of the identifier are
  501. produced with special characters prefixed with the escape
  502. character.
  503. string - The characters of the string are produced surrounded by
  504. double quotes "...".
  505. function-pointer - The value of the function-pointer is created as
  506. a list of characters conforming to the conventions of the system
  507. site.
  508. The type mismatch error occurs if U is not a number, identifier,
  509. string, or function-pointer.
  510. GENSYM():id
  511. Creates an identifier which is not interned on the OBLIST and
  512. consequently not EQ to anything else.
  513. INTERN(U:{id,string}):id
  514. Type: EVAL, SPREAD
  515. INTERN searches the OBLIST for an identifier with the same print name
  516. as U and returns the identifier on the OBLIST if a match is found.
  517. Any properties and global values associated with U may be lost. If U
  518. does not match any entry, a new one is created and returned. If U has
  519. more than the maximum number of characters permitted by the
  520. implementation (the minimum number is 24) an error occurs:
  521. ***** Too many characters to INTERN
  522. REMOB(U:id):id
  523. Type: EVAL, SPREAD
  524. If U is present on the OBLIST it is removed. This does not affect U
  525. having properties, flags, functions and the like. U is returned.
  526. 3.4 Property List Functions.
  527. With each id in the system is a "property list", a set of
  528. entities which are associated with the id for fast access. These
  529. entities are called "flags" if their use gives the id a single valued
  530. property, and "properties" if the id is to have a multivalued
  531. attribute: an indicator with a property.
  532. Flags and indicators may clash, consequently care should be
  533. taken to avoid this occurrence. Flagging X with an id which already
  534. is an indicator for X may result in that indicator and associated
  535. Standard LISP Report. 14
  536. 3.4 Property List Functions.
  537. property being lost. Likewise, adding an indicator which is the same
  538. id as a flag may result in the flag being destroyed.
  539. FLAG(U:id-list, V:id):NIL
  540. Type: EVAL, SPREAD
  541. U is a list of ids which are flagged with V. The effect of FLAG is
  542. that FLAGP will have the value T for those ids of U which were
  543. flagged. Both V and all the elements of U must be identifiers or the
  544. type mismatch error occurs.
  545. FLAGP(U:any, V:any):boolean
  546. Type: EVAL, SPREAD
  547. Returns T if U has been previously flagged with V, else NIL. Returns
  548. NIL if either U or V is not an id.
  549. GET(U:any, IND:any):any
  550. Type: EVAL, SPREAD
  551. Returns the property associated with indicator IND from the property
  552. list of U. If U does not have indicator IND, NIL is returned. GET
  553. cannot be used to access functions (use GETD instead).
  554. PUT(U:id, IND:id, PROP:any):any
  555. Type: EVAL, SPREAD
  556. The indicator IND with the property PROP is placed on the property
  557. list of the id U. If the action of PUT occurs, the value of PROP is
  558. returned. If either of U and IND are not ids the type mismatch error
  559. will occur and no property will be placed. PUT cannot be used to
  560. define functions (use PUTD instead).
  561. REMFLAG(U:any-list, V:id):NIL
  562. Type: EVAL, SPREAD
  563. Removes the flag V from the property list of each member of the list
  564. U. Both V and all the elements of U must be ids or the type mismatch
  565. error will occur.
  566. REMPROP(U:any, IND:any):any
  567. Type: EVAL, SPREAD
  568. Removes the property with indicator IND from the property list of U.
  569. Returns the removed property or NIL if there was no such indicator.
  570. Standard LISP Report. 15
  571. 3.5 Function Definition.
  572. 3.5 Function Definition.
  573. Functions in Standard LISP are global entities. To avoid
  574. function-variable naming clashes no variable may have the same name
  575. as a function.
  576. DE(FNAME:id, PARAMS:id-list, FN:any):id
  577. Type: NOEVAL, NOSPREAD
  578. The function FN with the formal parameter list PARAMS is added to the
  579. set of defined functions with the name FNAME. Any previous
  580. definitions of the function are lost. The function created is of type
  581. EXPR unless the !*COMP variable is T in which case the EXPR is
  582. compiled. The name of the defined function is returned.
  583. FEXPR PROCEDURE DE(U);
  584. PUTD(CAR U, 'EXPR, LIST('LAMBDA, CADR U, CADDR U));
  585. DF(FNAME:id, PARAM:id-list, FN:any):id
  586. Type: NOEVAL, NOSPREAD
  587. The function FN with formal parameter PARAM is added to the set of
  588. defined functions with the name FNAME. Any previous definitions of
  589. the function are lost. The function created is of type FEXPR unless
  590. the !*COMP variable is T in which case the FEXPR is compiled. The
  591. name of the defined function is returned.
  592. FEXPR PROCEDURE DF(U);
  593. PUTD(CAR U, 'FEXPR, LIST('LAMBDA, CADR U, CADDR U));
  594. DM(MNAME:id, PARAM:id-list, FN:any):id
  595. Type: NOEVAL, NOSPREAD
  596. The macro FN with the formal parameter PARAM is added to the set of
  597. defined functions with the name MNAME. Any previous definitions of
  598. the function are overwritten. The function created is of type MACRO.
  599. The name of the macro is returned.
  600. FEXPR PROCEDURE DM(U);
  601. PUTD(CAR U, 'MACRO, LIST('LAMBDA, CADR U, CADDR U));
  602. GETD(FNAME:any):{NIL, dotted-pair}
  603. Type: EVAL, SPREAD
  604. If FNAME is not the name of a defined function, NIL is returned. If
  605. FNAME is a defined function then the dotted-pair
  606. (TYPE:ftype . DEF:{function-pointer, lambda}) is returned.
  607. Standard LISP Report. 16
  608. 3.5 Function Definition.
  609. PUTD(FNAME:id, TYPE:ftype, BODY:function):id
  610. Type: EVAL, SPREAD
  611. Creates a function with name FNAME and definition BODY of type TYPE.
  612. If PUTD succeeds the name of the defined function is returned. The
  613. effect of PUTD is that GETD will return a dotted-pair with the
  614. functions type and definition. Likewise the GLOBALP predicate will
  615. return T when queried with the function name.
  616. If the function FNAME has already been declared as a GLOBAL or
  617. FLUID variable the error:
  618. ***** FNAME is a non-local variable
  619. occurs and the function will not be defined. If function FNAME
  620. already exists a warning message will appear:
  621. *** FNAME redefined
  622. The function defined by PUTD will be compiled before definition
  623. if the !*COMP global variable is non-NIL (see the "System GLOBAL
  624. Variables" section).
  625. REMD(FNAME:id):{NIL, dotted-pair}
  626. Type: EVAL, SPREAD
  627. Removes the function named FNAME from the set of defined functions.
  628. Returns the (ftype . function) dotted-pair or NIL as does GETD. The
  629. global/function attribute of FNAME is removed and the name may be
  630. used subsequently as a variable.
  631. 3.6 Variables and Bindings.
  632. A variable is a place holder for a Standard LISP entity which is
  633. said to be bound to the variable. The scope of a variable is the
  634. range over which the variable has a defined value. There are three
  635. different binding mechanisms in Standard LISP.
  636. Local Binding - This type of binding occurs only in compiled
  637. functions. Local variables occur as formal parameters in lambda
  638. expressions and as PROG form variables. The binding occurs when a
  639. lambda expression is evaluated or when a PROG form is executed.
  640. The scope of a local variable is the body of the function in which
  641. it is defined.
  642. Global Binding - Only one binding of a global variable exists at any
  643. time allowing direct access to the value bound to the variable.
  644. The scope of a global variable is universal. Variables declared
  645. GLOBAL may not appear as parameters in lambda expressions or as
  646. PROG form variables. A variable must be declared GLOBAL prior to
  647. its use as a global variable since the default type for undeclared
  648. variables is FLUID.
  649. Standard LISP Report. 17
  650. 3.6 Variables and Bindings.
  651. Fluid Binding - Fluid variables are global in scope but may occur as
  652. formal parameters or PROG form variables. In interpreted functions
  653. all formal parameters and PROG form variables are considered to
  654. have fluid binding until changed to local binding by compilation.
  655. When fluid variables are used as parameters they are rebound in
  656. such a way that the previous binding may be restored. All
  657. references to fluid variables are to the currently active binding.
  658. FLUID(IDLIST:id-list):NIL
  659. Type: EVAL, SPREAD
  660. The ids in IDLIST are declared as FLUID type variables (ids not
  661. previously declared are initialized to NIL). Variables in IDLIST
  662. already declared FLUID are ignored. Changing a variable's type from
  663. GLOBAL to FLUID is not permissible and results in the error:
  664. ***** ID cannot be changed to FLUID
  665. FLUIDP(U:any):boolean
  666. Type: EVAL, SPREAD
  667. If U has been declared FLUID (by declaration only) T is returned,
  668. otherwise NIL is returned.
  669. GLOBAL(IDLIST:id-list):NIL
  670. Type: EVAL, SPREAD
  671. The ids of IDLIST are declared global type variables. If an id has
  672. not been declared previously it is initialized to NIL. Variables
  673. already declared GLOBAL are ignored. Changing a variables type from
  674. FLUID to GLOBAL is not permissible and results in the error:
  675. ***** ID cannot be changed to GLOBAL
  676. GLOBALP(U:any):boolean
  677. Type: EVAL, SPREAD
  678. If U has been declared GLOBAL or is the name of a defined function, T
  679. is returned, else NIL is returned.
  680. Standard LISP Report. 18
  681. 3.6 Variables and Bindings.
  682. SET(EXP:id, VALUE:any):any
  683. Type: EVAL, SPREAD
  684. EXP must be an identifier or a type mismatch error occurs. The effect
  685. of SET is replacement of the item bound to the identifier by VALUE.
  686. If the identifier is not a local variable or has not been declared
  687. GLOBAL it is automatically declared FLUID with the resulting warning
  688. message:
  689. *** EXP declared FLUID
  690. EXP must not evaluate to T or NIL or an error occurs:
  691. ***** Cannot change T or NIL
  692. SETQ(VARIABLE:id, VALUE:any):any
  693. Type: NOEVAL, NOSPREAD
  694. If VARIABLE is not local or GLOBAL it is by default declared FLUID
  695. and the warning message:
  696. *** VARIABLE declared FLUID
  697. appears. The value of the current binding of VARIABLE is replaced by
  698. the value of VALUE. VARIABLE must not be T or NIL or an error occurs:
  699. ***** Cannot change T or NIL
  700. MACRO PROCEDURE SETQ(X);
  701. LIST('SET, LIST('QUOTE, CADR X), CADDR X);
  702. UNFLUID(IDLIST:id-list):NIL
  703. Type: EVAL, SPREAD
  704. The variables in IDLIST that have been declared as FLUID variables
  705. are no longer considered as fluid variables. Others are ignored. This
  706. affects only compiled functions as free variables in interpreted
  707. functions are automatically considered fluid (see Ref. [1]).
  708. 3.7 Program Feature Functions.
  709. These functions provide for explicit control sequencing, and the
  710. definition of blocks altering the scope of local variables.
  711. Standard LISP Report. 19
  712. 3.7 Program Feature Functions.
  713. GO(LABEL:id)
  714. Type: NOEVAL, NOSPREAD
  715. GO alters the normal flow of control within a PROG function. The next
  716. statement of a PROG function to be evaluated is immediately preceded
  717. by LABEL. A GO may only appear in the following situations:
  718. 1) At the top level of a PROG referencing a label which also
  719. appears at the top level of the same PROG.
  720. 2a) As the consequent of a COND item of a COND appearing on the top
  721. level of a PROG.
  722. 2b) As the consequent of a COND item which appears as the
  723. consequent of a COND item to any level.
  724. 3a) As the last statement of a PROGN which appears at the top level
  725. of a PROG or in a PROGN appearing in the consequent of a COND to
  726. any level subject to the restrictions of 2a,b.
  727. 3b) As the last statement of a PROGN within a PROGN or as the
  728. consequent of a COND in a PROGN to any level subject to the
  729. restrictions of 2a,b and 3a.
  730. If LABEL does not appear at the top level of the PROG in which
  731. the GO appears, an error occurs:
  732. ***** LABEL is not a known label
  733. If the GO has been placed in a position not defined by rules
  734. 1-3, another error is detected:
  735. ***** Illegal use of GO to LABEL
  736. PROG(VARS:id-list, [PROGRAM:{id, any}]):any
  737. Type: NOEVAL, NOSPREAD
  738. VARS is a list of ids which are considered fluid when the PROG is
  739. interpreted and local when compiled (see the "Variables and Bindings"
  740. section). The PROGs variables are allocated space when the PROG form
  741. is invoked and are deallocated when the PROG is exited. PROG
  742. variables are initialized to NIL. The PROGRAM is a set of expressions
  743. to be evaluated in order of their appearance in the PROG function.
  744. Identifiers appearing in the top level of the PROGRAM are labels
  745. which can be referenced by GO. The value returned by the PROG
  746. function is determined by a RETURN function or NIL if the PROG "falls
  747. through".
  748. PROGN([U:any]):any
  749. Type: NOEVAL, NOSPREAD
  750. U is a set of expressions which are executed sequentially. The value
  751. returned is the value of the last expression.
  752. Standard LISP Report. 20
  753. 3.7 Program Feature Functions.
  754. RETURN(U:any)
  755. Type: EVAL, SPREAD
  756. Within a PROG, RETURN terminates the evaluation of a PROG and returns
  757. U as the value of the PROG. The restrictions on the placement of
  758. RETURN are exactly those of GO. Improper placement of RETURN results
  759. in the error:
  760. ***** Illegal use of RETURN
  761. 3.8 Error Handling.
  762. ERROR(NUMBER:integer, MESSAGE:any)
  763. Type: EVAL, SPREAD
  764. NUMBER and MESSAGE are passed back to a surrounding ERRORSET (the
  765. Standard LISP reader has an ERRORSET). MESSAGE is placed in the
  766. global variable EMSG!* and the error number becomes the value of the
  767. surrounding ERRORSET. FLUID variables and local bindings are unbound
  768. to return to the environment of the ERRORSET. Global variables are
  769. not affected by the process.
  770. ERRORSET(U:any, MSGP:boolean, TR:boolean):any
  771. Type: EVAL, SPREAD
  772. If an error occurs during the evaluation of U, the value of NUMBER
  773. from the ERROR call is returned as the value of ERRORSET. In
  774. addition, if the value of MSGP is non-NIL, the MESSAGE from the ERROR
  775. call is displayed upon both the standard output device and the
  776. currently selected output device unless the standard output device is
  777. not open. The message appears prefixed with 5 asterisks. The MESSAGE
  778. list is displayed without top level parentheses. The MESSAGE from the
  779. ERROR call will be available in the global variable EMSG!*. The exact
  780. format of error messages generated by Standard LISP functions
  781. described in this document are not fixed and should not be relied
  782. upon to be in any particular form. Likewise, error numbers generated
  783. by Standard LISP functions are implementation dependent.
  784. If no error occurs during the evaluation of U, the value of
  785. (LIST (EVAL U)) is returned.
  786. If an error has been signaled and the value of TR is non-NIL a
  787. traceback sequence will be initiated on the selected output device.
  788. The traceback will display information such as unbindings of FLUID
  789. variables, argument lists and so on in an implementation dependent
  790. format.
  791. Standard LISP Report. 21
  792. 3.9 Vectors.
  793. 3.9 Vectors.
  794. Vectors are structured entities in which random elements may be
  795. accessed with an integer index. A vector has a single dimension. Its
  796. maximum size is determined by the implementation and available space.
  797. A suggested input output "vector notation" is defined (see "Classes
  798. of Primitive Data Types").
  799. GETV(V:vector, INDEX:integer):any
  800. Type: EVAL, SPREAD
  801. Returns the value stored at position INDEX of the vector V. The type
  802. mismatch error may occur. An error occurs if the INDEX does not lie
  803. within 0...UPBV(V) inclusive:
  804. ***** INDEX subscript is out of range
  805. MKVECT(UPLIM:integer):vector
  806. Type: EVAL, SPREAD
  807. Defines and allocates space for a vector with UPLIM+1 elements
  808. accessed as 0...UPLIM. Each element is initialized to NIL. An error
  809. will occur if UPLIM is < 0 or there is not enough space for a vector
  810. of this size:
  811. ***** A vector of size UPLIM cannot be allocated
  812. PUTV(V:vector, INDEX:integer, VALUE:any):any
  813. Type: EVAL, SPREAD
  814. Stores VALUE into the vector V at position INDEX. VALUE is returned.
  815. The type mismatch error may occur. If INDEX does not lie in
  816. 0...UPBV(V) an error occurs:
  817. ***** INDEX subscript is out of range
  818. UPBV(U:any):{NIL,integer}
  819. Type: EVAL, SPREAD
  820. Returns the upper limit of U if U is a vector, or NIL if it is not.
  821. Standard LISP Report. 22
  822. 3.10 Boolean Functions and Conditionals.
  823. 3.10 Boolean Functions and Conditionals.
  824. AND([U:any]):extra-boolean
  825. Type: NOEVAL, NOSPREAD
  826. AND evaluates each U until a value of NIL is found or the end of the
  827. list is encountered. If a non-NIL value is the last value it is
  828. returned, or NIL is returned.
  829. FEXPR PROCEDURE AND(U);
  830. BEGIN
  831. IF NULL U THEN RETURN NIL;
  832. LOOP: IF NULL CDR U THEN RETURN EVAL CAR U
  833. ELSE IF NULL EVAL CAR U THEN RETURN NIL;
  834. U := CDR U;
  835. GO LOOP
  836. END;
  837. COND([U:cond-form]):any
  838. Type: NOEVAL, NOSPREAD
  839. The antecedents of all U's are evaluated in order of their appearance
  840. until a non-NIL value is encountered. The consequent of the selected
  841. U is evaluated and becomes the value of the COND. The consequent may
  842. also contain the special functions GO and RETURN subject to the
  843. restraints given for these functions in the "Program Feature
  844. Functions" section. In these cases COND does not have a defined
  845. value, but rather an effect. If no antecedent is non-NIL the value of
  846. COND is NIL. An error is detected if a U is improperly formed:
  847. ***** Improper cond-form as argument of COND
  848. NOT(U:any):boolean
  849. Type: EVAL, SPREAD
  850. If U is NIL, return T else return NIL (same as NULL function).
  851. EXPR PROCEDURE NOT(U);
  852. U EQ NIL;
  853. Standard LISP Report. 23
  854. 3.10 Boolean Functions and Conditionals.
  855. OR([U:any]):extra-boolean
  856. Type: NOEVAL, NOSPREAD
  857. U is any number of expressions which are evaluated in order of their
  858. appearance. When one is found to be non-NIL it is returned as the
  859. value of OR. If all are NIL, NIL is returned.
  860. FEXPR PROCEDURE OR(U);
  861. BEGIN SCALAR X;
  862. LOOP: IF NULL U THEN RETURN NIL
  863. ELSE IF (X := EVAL CAR U) THEN RETURN X;
  864. U := CDR U;
  865. GO LOOP
  866. END;
  867. 3.11 Arithmetic Functions.
  868. Conversions between numeric types are provided explicitly by the
  869. FIX and FLOAT functions and implicitly by any multi-parameter
  870. arithmetic function which receives mixed types of arguments. A
  871. conversion from fixed to floating point numbers may result in a loss
  872. of precision without a warning message being generated. Since
  873. integers may have a greater magnitude that that permitted for
  874. floating numbers, an error may be signaled when the attempted
  875. conversion cannot be done. Because the magnitude of integers is
  876. unlimited the conversion of a floating point number to a fixed number
  877. is always possible, the only loss of precision being the digits to
  878. the right of the decimal point which are truncated. If a function
  879. receives mixed types of arguments the general rule will have the
  880. fixed numbers converted to floating before arithmetic operations are
  881. performed. In all cases an error occurs if the parameter to an
  882. arithmetic function is not a number:
  883. ***** XXX parameter to FUNCTION is not a number
  884. XXX is the value of the parameter at fault and FUNCTION is the name
  885. of the function that detected the error. Exceptions to the rule are
  886. noted where they occur.
  887. ABS(U:number):number
  888. Type: EVAL, SPREAD
  889. Returns the absolute value of its argument.
  890. EXPR PROCEDURE ABS(U);
  891. IF LESSP(U, 0) THEN MINUS(U) ELSE U;
  892. Standard LISP Report. 24
  893. 3.11 Arithmetic Functions.
  894. DIFFERENCE(U:number, V:number):number
  895. Type: EVAL, SPREAD
  896. The value U - V is returned.
  897. DIVIDE(U:number, V:number):dotted-pair
  898. Type: EVAL, SPREAD
  899. The dotted-pair (quotient . remainder) is returned. The quotient part
  900. is computed the same as by QUOTIENT and the remainder the same as by
  901. REMAINDER. An error occurs if division by zero is attempted:
  902. ***** Attempt to divide by 0 in DIVIDE
  903. EXPR PROCEDURE DIVIDE(U, V);
  904. (QUOTIENT(U, V) . REMAINDER(U, V));
  905. EXPT(U:number, V:integer):number
  906. Type: EVAL, SPREAD
  907. Returns U raised to the V power. A floating point U to an integer
  908. power V does not have V changed to a floating number before
  909. exponentiation.
  910. FIX(U:number):integer
  911. Type: EVAL, SPREAD
  912. Returns an integer which corresponds to the truncated value of U. The
  913. result of conversion must retain all significant portions of U. If U
  914. is an integer it is returned unchanged.
  915. FLOAT(U:number):floating
  916. Type: EVAL, SPREAD
  917. The floating point number corresponding to the value of the argument
  918. U is returned. Some of the least significant digits of an integer may
  919. be lost do to the implementaion of floating point numbers. FLOAT of a
  920. floating point number returns the number unchanged. If U is too large
  921. to represent in floating point an error occurs:
  922. ***** Argument to FLOAT is too large
  923. GREATERP(U:number, V:number):boolean
  924. Type: EVAL, SPREAD
  925. Returns T if U is strictly greater than V, otherwise returns NIL.
  926. LESSP(U:number, V:number):boolean
  927. Type: EVAL, SPREAD
  928. Returns T if U is strictly less than V, otherwise returns NIL.
  929. Standard LISP Report. 25
  930. 3.11 Arithmetic Functions.
  931. MAX([U:number]):number
  932. Type: NOEVAL, NOSPREAD, or MACRO
  933. Returns the largest of the values in U. If two or more values are the
  934. same the first is returned.
  935. MACRO PROCEDURE MAX(U);
  936. EXPAND(CDR U, 'MAX2);
  937. MAX2(U:number, V:number):number
  938. Type: EVAL, SPREAD
  939. Returns the larger of U and V. If U and V are the same value U is
  940. returned (U and V might be of different types).
  941. EXPR PROCEDURE MAX2(U, V);
  942. IF LESSP(U, V) THEN V ELSE U;
  943. MIN([U:number]):number
  944. Type: NOEVAL, NOSPREAD, or MACRO
  945. Returns the smallest of the values in U. If two ore more values are
  946. the same the first of these is returned.
  947. MACRO PROCEDURE MIN(U);
  948. EXPAND(CDR U, 'MIN2);
  949. MIN2(U:number, V:number):number
  950. Type: EVAL, SPREAD
  951. Returns the smaller of its arguments. If U and V are the same value,
  952. U is returned (U and V might be of different types).
  953. EXPR PROCEDURE MIN2(U, V);
  954. IF GREATERP(U, V) THEN V ELSE U;
  955. MINUS(U:number):number
  956. Type: EVAL, SPREAD
  957. Returns -U.
  958. EXPR PROCEDURE MINUS(U);
  959. DIFFERENCE(0, U);
  960. PLUS([U:number]):number
  961. Type: NOEVAL, NOSPREAD, or MACRO
  962. Forms the sum of all its arguments.
  963. MACRO PROCEDURE PLUS(U);
  964. EXPAND(CDR U, 'PLUS2);
  965. Standard LISP Report. 26
  966. 3.11 Arithmetic Functions.
  967. PLUS2(U:number, V:number):number
  968. Type: EVAL, SPREAD
  969. Returns the sum of U and V.
  970. QUOTIENT(U:number, V:number):number
  971. Type: EVAL, SPREAD
  972. The quotient of U divided by V is returned. Division of two positive
  973. or two negative integers is conventional. When both U and V are
  974. integers and exactly one of them is negative the value returned is
  975. the negative truncation of the absolute value of U divided by the
  976. absolute value of V. An error occurs if division by zero is
  977. attempted:
  978. ***** Attempt to divide by 0 in QUOTIENT
  979. REMAINDER(U:number, V:number):number
  980. Type: EVAL, SPREAD
  981. If both U and V are integers the result is the integer remainder of U
  982. divided by V. If either parameter is floating point, the result is
  983. the difference between U and V*(U/V) all in floating point. If either
  984. number is negative the remainder is negative. If both are positive or
  985. both are negative the remainder is positive. An error occurs if V is
  986. zero:
  987. ***** Attempt to divide by 0 in REMAINDER
  988. EXPR PROCEDURE REMAINDER(U, V);
  989. DIFFERENCE(U, TIMES2(QUOTIENT(U, V), V));
  990. TIMES([U:number]):number
  991. Type: NOEVAL, NOSPREAD, or MACRO
  992. Returns the product of all its arguments.
  993. MACRO PROCEDURE TIMES(U);
  994. EXPAND(CDR U, 'TIMES2);
  995. TIMES2(U:number, V:number):number
  996. Type: EVAL, SPREAD
  997. Returns the product of U and V.
  998. Standard LISP Report. 27
  999. 3.12 MAP Composite Functions.
  1000. 3.12 MAP Composite Functions.
  1001. MAP(X:list, FN:function):any
  1002. Type: EVAL, SPREAD
  1003. Applies FN to successive CDR segments of X. NIL is returned.
  1004. EXPR PROCEDURE MAP(X, FN);
  1005. WHILE X DO << FN X;
  1006. X := CDR X >>;
  1007. MAPC(X:list, FN:function):any
  1008. Type: EVAL, SPREAD
  1009. FN is applied to successive CAR segments of list X. NIL is returned.
  1010. EXPR PROCEDURE MAPC(X, FN);
  1011. WHILE X DO << FN CAR X;
  1012. X := CDR X >>;
  1013. MAPCAN(X:list, FN:function):any
  1014. Type: EVAL, SPREAD
  1015. A concatenated list of FN applied to successive CAR elements of X is
  1016. returned.
  1017. EXPR PROCEDURE MAPCAN(X, FN);
  1018. IF NULL X THEN NIL
  1019. ELSE NCONC(FN CAR X, MAPCAN(CDR X, FN));
  1020. MAPCAR(X:list, FN:function):any
  1021. Type: EVAL, SPREAD
  1022. Returned is a constructed list of FN applied to each CAR of list X.
  1023. EXPR PROCEDURE MAPCAR(X, FN);
  1024. IF NULL X THEN NIL
  1025. ELSE FN CAR X . MAPCAR(CDR X, FN);
  1026. MAPCON(X:list, FN:function):any
  1027. Type: EVAL, SPREAD
  1028. Returned is a concatenated list of FN applied to successive CDR
  1029. segments of X.
  1030. EXPR PROCEDURE MAPCON(X, FN);
  1031. IF NULL X THEN NIL
  1032. ELSE NCONC(FN X, MAPCON(CDR X, FN));
  1033. Standard LISP Report. 28
  1034. 3.12 MAP Composite Functions.
  1035. MAPLIST(X:list, FN:function):any
  1036. Type: EVAL, SPREAD
  1037. Returns a constructed list of FN applied to successive CDR segments
  1038. of X.
  1039. EXPR PROCEDURE MAPLIST(X, FN);
  1040. IF NULL X THEN NIL
  1041. ELSE FN X . MAPLIST(CDR X, FN);
  1042. 3.13 Composite Functions.
  1043. APPEND(U:list, V:list):list
  1044. Type: EVAL, SPREAD
  1045. Returns a constructed list in which the last element of U is followed
  1046. by the first element of V. The list U is copied, V is not.
  1047. EXPR PROCEDURE APPEND(U, V);
  1048. IF NULL U THEN V
  1049. ELSE CAR U . APPEND(CDR U, V);
  1050. ASSOC(U:any, V:alist):{dotted-pair, NIL}
  1051. Type: EVAL, SPREAD
  1052. If U occurs as the CAR portion of an element of the alist V, the
  1053. dotted-pair in which U occurred is returned, else NIL is returned.
  1054. ASSOC might not detect a poorly formed alist so an invalid
  1055. construction may be detected by CAR or CDR.
  1056. EXPR PROCEDURE ASSOC(U, V);
  1057. IF NULL V THEN NIL
  1058. ELSE IF ATOM CAR V THEN
  1059. ERROR(000, LIST(V, "is a poorly formed alist"))
  1060. ELSE IF U = CAAR V THEN CAR V
  1061. ELSE ASSOC(U, CDR V);
  1062. Standard LISP Report. 29
  1063. 3.13 Composite Functions.
  1064. DEFLIST(U:dlist, IND:id):list
  1065. Type: EVAL, SPREAD
  1066. A "dlist" is a list in which each element is a two element list:
  1067. (ID:id PROP:any). Each ID in U has the indicator IND with property
  1068. PROP placed on its property list by the PUT function. The value of
  1069. DEFLIST is a list of the first elements of each two element list.
  1070. Like PUT, DEFLIST may not be used to define functions.
  1071. EXPR PROCEDURE DEFLIST(U, IND);
  1072. IF NULL U THEN NIL
  1073. ELSE <<PUT(CAAR U, IND, CADAR U);
  1074. CAAR U >> . DEFLIST(CDR U, IND);
  1075. DELETE(U:any, V:list):list
  1076. Type: EVAL, SPREAD
  1077. Returns V with the first top level occurrence of U removed from it.
  1078. EXPR PROCEDURE DELETE(U, V);
  1079. IF NULL V THEN NIL
  1080. ELSE IF CAR V = U THEN CDR V
  1081. ELSE CAR V . DELETE(U, CDR V);
  1082. DIGIT(U:any):boolean
  1083. Type: EVAL, SPREAD
  1084. Returns T if U is a digit, otherwise NIL.
  1085. EXPR PROCEDURE DIGIT(U);
  1086. IF MEMQ(U, '(!0 !1 !2 !3 !4 !5 !6 !7 !8 !9))
  1087. THEN T ELSE NIL;
  1088. LENGTH(X:any):integer
  1089. Type: EVAL, SPREAD
  1090. The top level length of the list X is returned.
  1091. EXPR PROCEDURE LENGTH(X);
  1092. IF ATOM X THEN 0
  1093. ELSE PLUS(1, LENGTH CDR X);
  1094. LITER(U:any):boolean
  1095. Type: EVAL, SPREAD
  1096. Returns T if U is a character of the alphabet, NIL otherwise.
  1097. EXPR PROCEDURE LITER(U);
  1098. IF MEMQ(U, '(A B C D E F G H I J K L M N O P Q R S T
  1099. U V W X Y Z a b c d e f g h i j k l m n o p
  1100. q r s t u v w x y z))
  1101. THEN T ELSE NIL;
  1102. Standard LISP Report. 30
  1103. 3.13 Composite Functions.
  1104. MEMBER(A:any, B:list):extra-boolean
  1105. Type: EVAL, SPREAD
  1106. Returns NIL if A is not a member of list B, returns the remainder of
  1107. B whose first element is A.
  1108. EXPR PROCEDURE MEMBER(A, B);
  1109. IF NULL B THEN NIL
  1110. ELSE IF A = CAR B THEN B
  1111. ELSE MEMBER(A, CDR B);
  1112. MEMQ(A:any, B:list):extra-boolean
  1113. Type: EVAL, SPREAD
  1114. Same as MEMBER but an EQ check is used for comparison.
  1115. EXPR PROCEDURE MEMQ(A, B);
  1116. IF NULL B THEN NIL
  1117. ELSE IF A EQ CAR B THEN B
  1118. ELSE MEMQ(A, CDR B);
  1119. NCONC(U:list, V:list):list
  1120. Type: EVAL, SPREAD
  1121. Concatenates V to U without copying U. The last CDR of U is modified
  1122. to point to V.
  1123. EXPR PROCEDURE NCONC(U, V);
  1124. BEGIN SCALAR W;
  1125. IF NULL U THEN RETURN V;
  1126. W := U;
  1127. WHILE CDR W DO W := CDR W;
  1128. RPLACD(W, V);
  1129. RETURN U
  1130. END;
  1131. PAIR(U:list, V:list):alist
  1132. Type: EVAL, SPREAD
  1133. U and V are lists which must have an identical number of elements. If
  1134. not, an error occurs (the 000 used in the ERROR call is arbitrary and
  1135. need not be adhered to). Returned is a list where each element is a
  1136. dotted-pair, the CAR of the pair being from U, and the CDR the
  1137. corresponding element from V.
  1138. EXPR PROCEDURE PAIR(U, V);
  1139. IF AND(U, V) THEN (CAR U . CAR V) . PAIR(CDR U, CDR V)
  1140. ELSE IF OR(U, V) THEN ERROR(000,
  1141. "Different length lists in PAIR")
  1142. ELSE NIL;
  1143. Standard LISP Report. 31
  1144. 3.13 Composite Functions.
  1145. REVERSE(U:list):list
  1146. Type: EVAL, SPREAD
  1147. Returns a copy of the top level of U in reverse order.
  1148. EXPR PROCEDURE REVERSE(U);
  1149. BEGIN SCALAR W;
  1150. WHILE U DO << W := CAR U . W;
  1151. U := CDR U >>;
  1152. RETURN W
  1153. END;
  1154. SASSOC(U:any, V:alist, FN:function):any
  1155. Type: EVAL, SPREAD
  1156. Searches the alist V for an occurrence of U. If U is not in the alist
  1157. the evaluation of function FN is returned.
  1158. EXPR PROCEDURE SASSOC(U, V, FN);
  1159. IF NULL V THEN FN()
  1160. ELSE IF U = CAAR V THEN CAR V
  1161. ELSE SASSOC(U, CDR V, FN);
  1162. SUBLIS(X:alist, Y:any):any
  1163. Type: EVAL, SPREAD
  1164. The value returned is the result of substituting the CDR of each
  1165. element of the alist X for every occurrence of the CAR part of that
  1166. element in Y.
  1167. EXPR PROCEDURE SUBLIS(X, Y);
  1168. IF NULL X THEN Y
  1169. ELSE BEGIN SCALAR U;
  1170. U := ASSOC(Y, X);
  1171. RETURN IF U THEN CDR U
  1172. ELSE IF ATOM Y THEN Y
  1173. ELSE SUBLIS(X, CAR Y) . SUBLIS(X, CDR Y)
  1174. END;
  1175. SUBST(U:any, V:any, W:any):any
  1176. Type: EVAL, SPREAD
  1177. The value returned is the result of substituting U for all
  1178. occurrences of V in W.
  1179. EXPR PROCEDURE SUBST(U, V, W);
  1180. IF NULL W THEN NIL
  1181. ELSE IF V = W THEN U
  1182. ELSE IF ATOM W THEN W
  1183. ELSE SUBST(U, V, CAR W) . SUBST(U, V, CDR W);
  1184. Standard LISP Report. 32
  1185. 3.14 The Interpreter.
  1186. 3.14 The Interpreter.
  1187. APPLY(FN:{id,function}, ARGS:any-list):any
  1188. Type: EVAL, SPREAD
  1189. APPLY returns the value of FN with actual parameters ARGS. The actual
  1190. parameters in ARGS are already in the form required for binding to
  1191. the formal parameters of FN.
  1192. EXPR PROCEDURE APPLY(FN, ARGS);
  1193. BEGIN SCALAR DEFN;
  1194. IF CODEP FN THEN RETURN
  1195. {Spread the actual parameters in ARGS following the conventions
  1196. for calling functions, transfer to the entry point of the
  1197. function, and return the value returned by the function.};
  1198. IF IDP FN THEN RETURN
  1199. IF NULL(DEFN := GETD FN) THEN
  1200. ERROR(000, LIST(FN, "is an undefined function"))
  1201. ELSE IF CAR DEFN EQ 'EXPR THEN
  1202. APPLY(CDR DEFN, ARGS)
  1203. ELSE ERROR(000, LIST(FN, "cannot be evaluated by APPLY"));
  1204. IF OR(ATOM FN, NOT(CAR FN EQ 'LAMBDA)) THEN
  1205. ERROR(000, LIST(FN, "cannot be evaluated by APPLY"));
  1206. RETURN
  1207. {Bind the actual parameters in ARGS to the formal parameters of
  1208. the lambda expression. If the two lists are not of equal length
  1209. then ERROR(000, "Number of parameters do not match"); The value
  1210. returned is EVAL CADDR FN.}
  1211. END;
  1212. EVAL(U:any):any
  1213. Type: EVAL, SPREAD
  1214. The value of the expression U is computed. Error numbers are
  1215. arbitrary. Portions of EVAL involving machine specific coding are
  1216. expressed in English enclosed in brackets {...}.
  1217. EXPR PROCEDURE EVAL(U);
  1218. BEGIN SCALAR FN;
  1219. IF CONSTANTP U THEN RETURN U;
  1220. IF IDP U THEN RETURN
  1221. {U is an id. Return the value most currently bound to U or if
  1222. there is no such binding: ERROR(000, LIST("Unbound:", U))};
  1223. IF PAIRP CAR U THEN RETURN
  1224. IF CAAR U EQ 'LAMBDA THEN APPLY(CAR U, EVLIS CDR U)
  1225. ELSE ERROR(000, LIST(CAR U,
  1226. "improperly formed LAMBDA expression"))
  1227. ELSE IF CODEP CAR U THEN RETURN APPLY(CAR U, EVLIS CDR U);
  1228. FN := GETD CAR U;
  1229. IF NULL FN THEN
  1230. ERROR(000, LIST(CAR U, "is an undefined function"))
  1231. ELSE IF CAR FN EQ 'EXPR THEN
  1232. Standard LISP Report. 33
  1233. 3.14 The Interpreter.
  1234. RETURN APPLY(CDR FN, EVLIS CDR U)
  1235. ELSE IF CAR FN EQ 'FEXPR THEN
  1236. RETURN APPLY(CDR FN, LIST CDR U)
  1237. ELSE IF CAR FN EQ 'MACRO THEN
  1238. RETURN EVAL APPLY(CDR FN, LIST U)
  1239. END;
  1240. EVLIS(U:any-list):any-list
  1241. Type: EVAL, SPREAD
  1242. EVLIS returns a list of the evaluation of each element of U.
  1243. EXPR PROCEDURE EVLIS(U);
  1244. IF NULL U THEN NIL
  1245. ELSE EVAL CAR U . EVLIS CDR U;
  1246. EXPAND(L:list, FN:function):list
  1247. Type: EVAL, SPREAD
  1248. FN is a defined function of two arguments to be used in the expansion
  1249. of a MACRO. EXPAND returns a list in the form:
  1250. (FN L[0] (FN L[1] ... (FN L[n-1] L[n]) ... ))
  1251. "n" is the number of elements in L, L[i] is the ith element of L.
  1252. EXPR PROCEDURE EXPAND(L,FN);
  1253. IF NULL CDR L THEN CAR L
  1254. ELSE LIST(FN, CAR L, EXPAND(CDR L, FN));
  1255. FUNCTION(FN:function):function
  1256. Type: NOEVAL, NOSPREAD
  1257. The function FN is to be passed to another function. If FN is to have
  1258. side effects its free variables must be fluid or global. FUNCTION is
  1259. like QUOTE but its argument may be affected by compilation. We do not
  1260. consider FUNARGs in this report.
  1261. QUOTE(U:any):any
  1262. Type: NOEVAL, NOSPREAD
  1263. Stops evaluation and returns U unevaluated.
  1264. FEXPR PROCEDURE QUOTE(U);
  1265. CAR U;
  1266. Standard LISP Report. 34
  1267. 3.15 Input and Output.
  1268. 3.15 Input and Output.
  1269. The user normally communicates with Standard LISP through
  1270. "standard devices" . The default devices are selected in accordance
  1271. with the conventions of the implementation site. Other input and
  1272. output devices or files may be selected for reading and writing using
  1273. the functions described herein.
  1274. CLOSE(FILEHANDLE:any):any
  1275. Type: EVAL, SPREAD
  1276. Closes the file with the internal name FILEHANDLE writing any
  1277. necessary end of file marks and such. The value of FILEHANDLE is that
  1278. returned by the corresponding OPEN. The value returned is the value
  1279. of FILEHANDLE. An error occurs if the file can not be closed.
  1280. ***** FILEHANDLE could not be closed
  1281. EJECT():NIL
  1282. Causes a skip to the top of the next output page. Automatic EJECTs
  1283. are executed by the print functions when the length set by the
  1284. PAGELENGTH function is exceeded.
  1285. LINELENGTH(LEN:{integer, NIL}):integer
  1286. Type: EVAL, SPREAD
  1287. If LEN is an integer the maximum line length to be printed before the
  1288. print functions initiate an automatic TERPRI is set to the value LEN.
  1289. No initial Standard LISP line length is assumed. The previous line
  1290. length is returned except when LEN is NIL. This special case returns
  1291. the current line length and does not cause it to be reset. An error
  1292. occurs if the requested line length is too large for the currently
  1293. selected output file or LEN is negative or zero.
  1294. ***** LEN is an invalid line length
  1295. LPOSN():integer
  1296. Returns the number of lines printed on the current page. At the top
  1297. of a page, 0 is returned.
  1298. Standard LISP Report. 35
  1299. 3.15 Input and Output.
  1300. OPEN(FILE:any, HOW:id):any
  1301. Type: EVAL, SPREAD
  1302. Open the file with the system dependent name FILE for output if HOW
  1303. is EQ to OUTPUT, or input if HOW is EQ to INPUT. If the file is
  1304. opened successfully, a value which is internally associated with the
  1305. file is returned. This value must be saved for use by RDS and WRS. An
  1306. error occurs if HOW is something other than INPUT or OUTPUT or the
  1307. file can't be opened.
  1308. ***** HOW is not option for OPEN
  1309. ***** FILE could not be opened
  1310. PAGELENGTH(LEN:{integer, NIL}):integer
  1311. Type: EVAL, SPREAD
  1312. Sets the vertical length (in lines) of an output page. Automatic page
  1313. EJECTs are executed by the print functions when this length is
  1314. reached. The initial vertical length is implementation specific. The
  1315. previous page length is returned. If LEN is 0, no automatic page
  1316. ejects will occur.
  1317. POSN():integer
  1318. Returns the number of characters in the output buffer. When the
  1319. buffer is empty, 0 is returned.
  1320. PRINC(U:id):id
  1321. Type: EVAL, SPREAD
  1322. U must be a single character id such as produced by EXPLODE or read
  1323. by READCH or the value of !$EOL!$. The effect is the character U
  1324. displayed upon the currently selected output device. The value of
  1325. !$EOL!$ causes termination of the current line like a call to TERPRI.
  1326. PRINT(U:any):any
  1327. Type: EVAL, SPREAD
  1328. Displays U in READ readable format and terminates the print line. The
  1329. value of U is returned.
  1330. EXPR PROCEDURE PRINT(U);
  1331. BEGIN
  1332. PRIN1 U;
  1333. TERPRI();
  1334. RETURN U
  1335. END;
  1336. Standard LISP Report. 36
  1337. 3.15 Input and Output.
  1338. PRIN1(U:any):any
  1339. Type: EVAL, SPREAD
  1340. U is displayed in a READ readable form. The format of display is the
  1341. result of EXPLODE expansion; special characters are prefixed with the
  1342. escape character !, and strings are enclosed in "...". Lists are
  1343. displayed in list-notation and vectors in vector-notation .
  1344. PRIN2(U:any):any
  1345. Type: EVAL, SPREAD
  1346. U is displayed upon the currently selected print device but output is
  1347. not READ readable. The value of U is returned. Items are displayed as
  1348. described in the EXPLODE function with the exceptions that the escape
  1349. character does not prefix special characters and strings are not
  1350. enclosed in "...". Lists are displayed in list-notation and vectors
  1351. in vector-notation. The value of U is returned.
  1352. RDS(FILEHANDLE:any):any
  1353. Type: EVAL, SPREAD
  1354. Input from the currently selected input file is suspended and further
  1355. input comes from the file named. FILEHANDLE is a system dependent
  1356. internal name which is a value returned by OPEN. If FILEHANDLE is NIL
  1357. the standard input device is selected. When end of file is reached on
  1358. a non-standard input device, the standard input device is reselected.
  1359. When end of file occurs on the standard input device the Standard
  1360. LISP reader terminates. RDS returns the internal name of the
  1361. previously selected input file.
  1362. ***** FILEHANDLE could not be selected for input
  1363. READ():any
  1364. Returns the next expression from the file currently selected for
  1365. input. Valid input forms are: vector-notation, dot-notation,
  1366. list-notation, numbers, function-pointers, strings, and identifiers
  1367. with escape characters. Identifiers are interned on the OBLIST (see
  1368. the INTERN function in the "Identifiers" section). READ returns the
  1369. value of !$EOF!$ when the end of the currently selected input file is
  1370. reached.
  1371. READCH():id
  1372. Returns the next interned character from the file currently selected
  1373. for input. Two special cases occur. If all the characters in an input
  1374. record have been read, the value of !$EOL!$ is returned. If the file
  1375. selected for input has all been read the value of !$EOF!$ is
  1376. returned.
  1377. TERPRI():NIL
  1378. The current print line is terminated.
  1379. Standard LISP Report. 37
  1380. 3.15 Input and Output.
  1381. WRS(FILEHANDLE:any):any
  1382. Type: EVAL, SPREAD
  1383. Output to the currently active output file is suspended and further
  1384. output is directed to the file named. FILEHANDLE is an internal name
  1385. which is returned by OPEN. The file named must have been opened for
  1386. output. If FILEHANDLE is NIL the standard output device is selected.
  1387. WRS returns the internal name of the previously selected output file.
  1388. ***** FILEHANDLE could not be selected for output
  1389. 3.16 LISP Reader.
  1390. An EVAL read loop has been chosen to drive a Standard LISP
  1391. system to provide a continuity in functional syntax. Choices of
  1392. messages and the amount of extra information displayed are decisions
  1393. left to the implementor.
  1394. EXPR PROCEDURE STANDARD!-LISP();
  1395. BEGIN SCALAR VALUE;
  1396. RDS NIL; WRS NIL;
  1397. PRIN2 "Standard LISP"; TERPRI();
  1398. WHILE T DO
  1399. << PRIN2 "EVAL:"; TERPRI();
  1400. VALUE := ERRORSET(QUOTE EVAL READ(), T, T);
  1401. IF NOT ATOM VALUE THEN PRINT CAR VALUE;
  1402. TERPRI() >>;
  1403. END;
  1404. Standard LISP Report. 38
  1405. 4. System GLOBAL Variables.
  1406. 4. System GLOBAL Variables.
  1407. These variables provide global control of the LISP system, or
  1408. implement values which are constant throughout execution.
  1409. !*COMP - Initial value = NIL.
  1410. The value of !*COMP controls whether or not PUTD compiles the
  1411. function defined in its arguments before defining it. If !*COMP is
  1412. NIL the function is defined as an xEXPR. If !*COMP is something else
  1413. the function is first compiled. Compilation will produce certain
  1414. changes in the semantics of functions particularly FLUID type access.
  1415. EMSG!* - Initial value = NIL.
  1416. Will contain the MESSAGE generated by the last ERROR call (see the
  1417. "Error Handling" section).
  1418. !$EOF!$ - Value = an uninterned identifier
  1419. The value of !$EOF!$ is returned by all input functions when the end
  1420. of the currently selected input file is reached.
  1421. !$EOL!$ - Value = an uninterned identifier
  1422. The value of !$EOL!$ is returned by READCH when it reaches the end of
  1423. a logical input record. Likewise PRINC will terminate its current
  1424. line (like a call to TERPRI) when !$EOL!$ is its argument.
  1425. NIL - Value = NIL
  1426. NIL is a special global variable. It is protected from being modified
  1427. by SET or SETQ.
  1428. !*RAISE - Initial value = NIL
  1429. If !*RAISE is T all characters input through Standard LISP
  1430. input/output functions will be raised to upper case. If !*RAISE is
  1431. NIL characters will be input as is.
  1432. T - Value = T
  1433. T is a special global variable. It is protected from being modified
  1434. by SET or SETQ.
  1435. Standard LISP Report. 39
  1436. Acknowledgment. The authors would like to thank the following persons
  1437. whose helpful comments contributed to the completion of this
  1438. document. J. Fitch, I. Frick, E. Goto, S. Harrington, R. Jenks, A.
  1439. Lux, A. Norman, M. Rothstein, M. Wirth.
  1440. Standard LISP Report. 40
  1441. List of References.
  1442. List of References
  1443. [1] M. L. Griss, A. C. Hearn, A Portable LISP Compiler, (in
  1444. preparation).
  1445. [2] A. C. Hearn, Standard LISP, SIGPLAN Notices, ACM, Vol. 4, No. 9,
  1446. September 1966, Reprinted in SIGSAM Bulletin, ACM, Vol. 13, 1969, p.
  1447. 28-49.
  1448. [3] A. C. Hearn, REDUCE 2 Symbolic Mode Primer, Utah Computational
  1449. Physics, Operating Note No. 5.1, October 1974.
  1450. -, REDUCE 2 User's Manual, Utah Computational Physics, UCP-19, March
  1451. 1973.
  1452. [4] LISP Reference Manual, CDC-6000, Computation Center, The
  1453. University of Texas at Austin.
  1454. [5] LISP/360 Reference Manual, Stanford Center for Information
  1455. Processing, Stanford University.
  1456. [6] John McCarthy, Paul W. Abrahams, Daniel J. Edwards, Timothy P.
  1457. Hart, Michael I. Levin, LISP 1.5 Programmers Manual, The Computation
  1458. Center and Research Laboratory of Electronics, Massachusettes
  1459. Institute of Technology, The M.I.T. Press, Cambridge, Massachusettes,
  1460. 1965.
  1461. [7] MACLISP Reference Manual, March 6, 1976.
  1462. [8] J. Strother Moore II, The INTERLISP Virtual Machine
  1463. Specification, CSL 76-5 September 1976, XEROX, Palo Alto Research
  1464. Center.
  1465. [9] Mats Nordstrom, Erik Sandewall, Diz Breslow, LISP F1: A FORTRAN
  1466. Implementation of LISP 1.5, Uppsala University, Department of
  1467. Computer Sciences.
  1468. [10] Lynn H. Quam, Whitfield Diffie, Stanford LISP 1.6 Manual,
  1469. Stanford Artificial Intelligence Laboratory, Operating Note 28.7.
  1470. [11] Warren Teitelman, INTERLISP Reference Manual, XEROX, Palo Alto
  1471. Research Center, 1974.
  1472. [12] Clark Weissman, LISP 1.5 Primer, Dickenson Publishing Company,
  1473. Inc., 1967.
  1474. Standard LISP Report. 41
  1475. Appendix A. The Extended Syntax.
  1476. The Extended Syntax.
  1477. Whenever it is possible to define Standard LISP functions in
  1478. LISP the text of the function will appear in an extended syntax.
  1479. These definitions are supplied as an aid to understanding the
  1480. behavior of functions and not as a strict implementation guide. A
  1481. formal scheme for the translation of extended syntax to Standard LISP
  1482. is presented to eliminate misinterpretation of the definitions.
  1483. The goal of the transformation scheme is to produce a PUTD
  1484. invocation which has the function translated from the extended syntax
  1485. as its actual parameter. A rule has a name in brackets <...> by
  1486. which it is known and is defined by what follows the meta symbol ::=.
  1487. Each rule of the set consists of one or more "alternatives" separated
  1488. by the | meta symbol, being the different ways in which the rule will
  1489. be matched by source text. Each alternative is composed of a
  1490. "recognizer" and a "generator" separated by the ==> meta symbol. The
  1491. recognizer is a concatenation of any of three different forms. 1)
  1492. Terminals - Upper case lexemes and punctuation which is not part of
  1493. the meta syntax represent items which must appear as is in the source
  1494. text for the rule to succeed. 2) Rules - Lower case lexemes enclosed
  1495. in <...> are names of other rules. The source text is matched if the
  1496. named rule succeeds. 3) Primitives - Lower case singletons not in
  1497. brackets are names of primitives or primitive classes of Standard
  1498. LISP. The syntax and semantics of the primitives are given in Part
  1499. I.
  1500. The recognizer portion of the following rule matches an extended
  1501. syntax procedure:
  1502. <function> ::= ftype PROCEDURE id (<id list>); <statement>; ==>
  1503. A function is recognized as an "ftype" (one of the tokens EXPR,
  1504. FEXPR, etc.) followed by the keyword PROCEDURE, followed by an "id"
  1505. (the name of the function), followed by an "<id list>" (the formal
  1506. parameter names) enclosed in parentheses. A semicolon terminates the
  1507. title line. The body of the function is a <statement> followed by a
  1508. semicolon. For example:
  1509. EXPR PROCEDURE NULL(X); EQ(X, NIL);
  1510. satisfies the recognizer, causes the generator to be activated and
  1511. the rule to be matched successfully.
  1512. The generator is a template into which generated items are
  1513. substituted. The three syntactic entities have corresponding
  1514. meanings when they appear in the generator portion. 1) Terminals -
  1515. These lexemes are copied as is to the generated text. 2) Rules - If
  1516. Standard LISP Report. 42
  1517. Appendix A. The Extended Syntax.
  1518. a rule has succeeded in the recognizer section then the value of the
  1519. rule is the result of the generator portion of that rule. 3)
  1520. Primitives - When primitives are matched the primitive lexeme
  1521. replaces its occurrence in the generator.
  1522. If more than one occurrence of an item would cause ambiguity in
  1523. the generator portion this entity appears with a bracketed subscript.
  1524. Thus:
  1525. <conditional> ::=
  1526. IF <expression> THEN <statement[1]> ELSE <statement[2]>...
  1527. has occurrences of two different <statement>s. The generator portion
  1528. uses the subscripted entities to reference the proper generated
  1529. value.
  1530. The <function> rule appears in its entirety as:
  1531. <function> ::= ftype PROCEDURE id (<id list>); <statement>;
  1532. ==> (PUTD (QUOTE id) (QUOTE ftype)
  1533. (QUOTE (LAMBDA (<id list>) <statement>)))
  1534. If the recognizer succeeds (as it would in the case of the NULL
  1535. procedure example) the generator returns:
  1536. (PUTD (QUOTE NULL) (QUOTE EXPR) (QUOTE (LAMBDA (X) (EQ X NIL))))
  1537. The identifier in the template is replaced by the procedure name
  1538. NULL, <id list> by the single formal parameter X, the <statement> by
  1539. (EQ X NIL) which is the result of the <statement> generator. EXPR
  1540. replaces ftype, the type of the defined procedure.
  1541. The Extended Syntax Rules
  1542. <function> ::= ftype PROCEDURE id (<id list>); <statement>;
  1543. ==> (PUTD (QUOTE id) (QUOTE ftype)
  1544. (QUOTE (LAMBDA (<id list>) <statement>)))
  1545. <id list> ::= id ==> id
  1546. | id, <id list> ==> id <id list>
  1547. <statement> ::= <expression> ==> <expression>
  1548. | <proper statement> ==> <proper statement>
  1549. <proper statement> ::=
  1550. Standard LISP Report. 43
  1551. Appendix A. The Extended Syntax.
  1552. <assignment statement> ==> <assignment statement>
  1553. | <conditional statement> ==> <conditional statement>
  1554. | <while statement> ==> <while statement>
  1555. | <compound statement> ==> <compound statement>
  1556. <assignment statement> ::= id := <expression>
  1557. ==> (SETQ id <expression>)
  1558. <conditional statement> ::=
  1559. IF <expression> THEN <statement[1]> ELSE <statement[2]>
  1560. ==> (COND (<expression> <statement[1]>)
  1561. (T <statement[2]>))
  1562. | IF <expression> THEN <statement>
  1563. ==> (COND (<expression> <statement>))
  1564. <while statement> ::= WHILE <expression> DO <statement>
  1565. ==> (PROG NIL
  1566. LBL (COND ((NULL <expression>) (RETURN NIL)))
  1567. <statement>
  1568. (GO LBL))
  1569. <compound statement> ::=
  1570. BEGIN SCALAR <id list>; <program list> END
  1571. ==> (PROG (<id list>) <program list>)
  1572. | BEGIN <program list> END
  1573. ==> (PROG NIL <program list>)
  1574. | << <statement list> >> ==> (PROGN <statement list>)
  1575. <program list> ::= <full statement> ==> <full statement>
  1576. | <full statement> <program list>
  1577. ==> <full statement> <program list>
  1578. <full statement> ::= <statement> ==> <statement>
  1579. | id: ==> id
  1580. <statement list> ::= <statement> ==> <statement>
  1581. | <statement>; <statement list>
  1582. ==> <statement> <statement list>
  1583. <expression> ::= <expression[1]> . <expression[2]>
  1584. ==> (CONS <expression[1]> <expression[2]>
  1585. | <expression[1]> = <expression[2]>
  1586. ==> (EQUAL <expression[1]> <expression[2]>)
  1587. | <expression[1]> EQ <expression[2]>
  1588. ==> (EQ <expression[1]> <expression[2]>)
  1589. | '<expression> ==> (QUOTE <expression>)
  1590. | function <expression> ==> (function <expression>)
  1591. | function(<argument list>)
  1592. ==> (function <argument list>)
  1593. | number ==> number
  1594. | id ==> id
  1595. <argument list> ::= () ==>
  1596. | <expression> ==> <expression>
  1597. Standard LISP Report. 44
  1598. Appendix A. The Extended Syntax.
  1599. | <expression>, <argument list>
  1600. ==> <expression> <argument list>
  1601. Notice the three infix operators . EQ and = which are
  1602. translated into calls on CONS, EQ, and EQUAL respectively. Note also
  1603. that a call on a function which has no formal parameters must have ()
  1604. as an argument list. The QUOTE function is abbreviated by '.
  1605. Standard LISP Report. 45
  1606. Appendix B. Alphabetical List of Functions
  1607. The following is an alphabetical list of the Standard LISP functions
  1608. with formal parameters and the page on which they are defined.
  1609. ABS(U:number):number 23
  1610. AND([U:any]):extra-boolean 22
  1611. APPEND(U:list, V:list):list 28
  1612. APPLY(FN:{id,function}, ARGS:any-list):any 32
  1613. ASSOC(U:any, V:alist):{dotted-pair,NIL} 28
  1614. ATOM(U:any):boolean 9
  1615. CAR(U:dotted-pair):any 11
  1616. CDR(U:dotted-pair):any 11
  1617. CLOSE(FILEHANDLE:any):any 34
  1618. CODEP(U:any):boolean 9
  1619. COMPRESS(U:id-list):{atom}-{vector} 12
  1620. COND([U:cond-form]):any 22
  1621. CONS(U:any, V:any):dotted-pair 11
  1622. CONSTANTP(U:any):boolean 9
  1623. DE(FNAME:id, PARAMS:id-list, FN:any):id 15
  1624. DEFLIST(U:dlist, IND:id):list 29
  1625. DELETE(U:any, V:list):list 29
  1626. DF(FNAME:id, PARAM:id-list, FN:any):id 15
  1627. DIFFERENCE(U:number, V:number):number 24
  1628. DIGIT(U:any):boolean 29
  1629. DIVIDE(U:number, V:number):dotted-pair 24
  1630. DM(MNAME:id, PARAM:id-list, FN:any):id 15
  1631. EJECT():NIL 34
  1632. EQ(U:any, V:any):boolean 9
  1633. EQN(U:any, V:any):boolean 9
  1634. EQUAL(U:any, V:any):boolean 9
  1635. ERROR(NUMBER:integer, MESSAGE:any) 20
  1636. ERRORSET(U:any, MSGP:boolean, TR:boolean):any 20
  1637. EVAL(U:any):any 32
  1638. EVLIS(U:any-list):any-list 33
  1639. EXPAND(L:list, FN:function):list 33
  1640. EXPLODE(U:{atom}-{vector}):id-list 12
  1641. EXPT(U:number, V:integer):number 24
  1642. FIX(U:number):integer 24
  1643. FIXP(U:any):boolean 10
  1644. FLAG(U:id-list, V:id):NIL 14
  1645. FLAGP(U:any, V:any):boolean 14
  1646. FLOAT(U:number):floating 24
  1647. FLOATP(U:any):boolean 10
  1648. FLUID(IDLIST:id-list):NIL 17
  1649. FLUIDP(U:any):boolean 17
  1650. FUNCTION(FN:function):function 33
  1651. Standard LISP Report. 46
  1652. Appendix B. Alphabetical List of Functions
  1653. GENSYM():id 13
  1654. GET(U:any, IND:any):any 14
  1655. GETD(FNAME:any):{NIL, dotted-pair} 15
  1656. GETV(V:vector, INDEX:integer):any 21
  1657. GLOBAL(IDLIST:id-list):NIL 17
  1658. GLOBALP(U:any):boolean 17
  1659. GO(LABEL:id) 19
  1660. GREATERP(U:number, V:number):boolean 24
  1661. IDP(U:any):boolean 10
  1662. INTERN(U:{id,string}):id 13
  1663. LENGTH(X:any):integer 29
  1664. LESSP(U:number, V:number):boolean 24
  1665. LINELENGTH(LEN:{integer,NIL}):integer 34
  1666. LIST([U:any]):list 11
  1667. LITER(U:any):boolean 29
  1668. LPOSN():integer 34
  1669. MAP(X:list, FN:function):any 27
  1670. MAPC(X:list, FN:function):any 27
  1671. MAPCAN(X:list, FN:function):any 27
  1672. MAPCAR(X:list, FN:function):any 27
  1673. MAPCON(X:list, FN:function):any 27
  1674. MAPLIST(X:list, FN:function):any 28
  1675. MAX([U:number]):number 25
  1676. MAX2(U:number, V:number):number 25
  1677. MEMBER(A:any, B:list):extra-boolean 30
  1678. MEMQ(A:any, B:list):extra-boolean 30
  1679. MIN([U:number]):number 25
  1680. MINUS(U:number):number 25
  1681. MIN2(U:number, V:number):number 25
  1682. MKVECT(UPLIM:integer):vector 21
  1683. NCONC(U:list, V:list):list 30
  1684. NOT(U:any):boolean 22
  1685. NULL(U:any):boolean 10
  1686. NUMBERP(U:any):boolean 10
  1687. OPEN(FILE:any, HOW:id):any 35
  1688. OR([U:any]):extra-boolean 23
  1689. PAGELENGTH(LEN:{integer,NIL}):integer 35
  1690. PAIR(U:list, V:list):alist 30
  1691. PAIRP(U:any):boolean 10
  1692. PLUS([U:number]):number 25
  1693. PLUS2(U:number, V:number):number 26
  1694. POSN():integer 35
  1695. PRINC(U:id):id 35
  1696. PRINT(U:any):any 35
  1697. PRIN1(U:any):any 36
  1698. PRIN2(U:any):any 36
  1699. PROG(VARS:id-list, [PROGRAM:{id,any}]):any 19
  1700. PROGN([U:any]):any 19
  1701. Standard LISP Report. 47
  1702. Appendix B. Alphabetical List of Functions
  1703. PUT(U:id, IND:id, PROP:any):any 14
  1704. PUTD(FNAME:id, TYPE:ftype, BODY:function):id 16
  1705. PUTV(V:vector, INDEX:integer, VALUE:any):any 21
  1706. QUOTE(U:any):any 33
  1707. QUOTIENT(U:number, V:number):number 26
  1708. RDS(FILEHANDLE:any):any 36
  1709. READ():any 36
  1710. READCH():id 36
  1711. REMAINDER(U:number, V:number):number 26
  1712. REMD(FNAME:id):{NIL, dotted-pair} 16
  1713. REMFLAG(U:any-list, V:id):NIL 14
  1714. REMOB(U:id):id 13
  1715. REMPROP(U:any, IND:any):any 14
  1716. RETURN(U:any) 20
  1717. REVERSE(U:list):list 31
  1718. RPLACA(U:dotted-pair, V:any):dotted-pair 12
  1719. RPLACD(U:dotted-pair, V:any):dotted-pair 12
  1720. SASSOC(U:any, V:alist, FN:function):any 31
  1721. SET(EXP:id, VALUE:any):any 18
  1722. SETQ(VARIABLE:id, VALUE:any):any 18
  1723. STRINGP(U:any):boolean 10
  1724. SUBLIS(X:alist, Y:any):any 31
  1725. SUBST(U:any, V:any, W:any):any 31
  1726. TERPRI():NIL 36
  1727. TIMES([U:number]):number 26
  1728. TIMES2(U:number, V:number):number 26
  1729. UNFLUID(IDLIST:id-list):NIL 18
  1730. UPBV(U:any):{NIL,integer} 21
  1731. VECTORP(U:any):boolean 10
  1732. WRS(FILEHANDLE:any):any 37
  1733. Standard LISP Report. 48
  1734. Index.
  1735. Index.
  1736. !$EOF!$, 36, 38
  1737. !$EOL!$, 36, 38
  1738. !*COMP, 15, 38
  1739. !*RAISE, 38
  1740. ABS, 23
  1741. alist, 6
  1742. AND, 22
  1743. antecedent, 6
  1744. any, 6
  1745. APPEND, 28
  1746. APPLY, 32
  1747. Arithmetic Functions, 23
  1748. ASSOC, 28
  1749. association list, 6
  1750. ATOM, 9
  1751. atom, 6
  1752. binding, 3
  1753. boolean, 5
  1754. Boolean Functions, 22
  1755. C...R composites, 11
  1756. CAR, 11
  1757. CDR, 11
  1758. CLOSE, 34
  1759. CODEP, 5, 9
  1760. Composite functions, 28
  1761. COMPRESS, 12
  1762. COND, 22
  1763. cond-form, 6
  1764. Conditional, 22
  1765. CONS, 11
  1766. consequent, 6
  1767. constant, 6
  1768. CONSTANTP, 9
  1769. DE, 15
  1770. DEFLIST, 29
  1771. DELETE, 29
  1772. DF, 15
  1773. DIFFERENCE, 24
  1774. DIGIT, 29
  1775. DIVIDE, 24
  1776. DM, 15
  1777. dot-notation, 4, 36
  1778. dotted-pair, 4
  1779. Standard LISP Report. 49
  1780. Index.
  1781. EJECT, 34
  1782. Elementary Predicates, 9
  1783. EMSG!*, 20, 38
  1784. EQ, 9
  1785. EQN, 9
  1786. EQUAL, 9
  1787. ERROR, 20
  1788. ERROR handling, 8, 20
  1789. Error messages, 8
  1790. ERRORSET, 20
  1791. escape character, 4, 13
  1792. EVAL, 32
  1793. EVAL functions, 7
  1794. EVAL, SPREAD functions, 7
  1795. EVAL, SPREAD parameter limit, 7
  1796. EVLIS, 33
  1797. EXPAND, 33
  1798. EXPLODE, 12
  1799. EXPR, 5
  1800. EXPT, 24
  1801. extra-boolean, 5
  1802. FEXPR, 5
  1803. FIX, 24
  1804. FIXP, 10
  1805. FLAG, 14
  1806. FLAGP, 14
  1807. flags, 3, 13
  1808. FLOAT, 24
  1809. floating, 3, 12
  1810. FLOATP, 10
  1811. FLUID, 17
  1812. fluid binding, 17
  1813. FLUIDP, 17
  1814. ftype, 5
  1815. funargs, 33
  1816. FUNCTION, 33
  1817. function, 3, 7
  1818. Function Definition, 15
  1819. function-pointer, 5, 13
  1820. Functions on Dotted-Pairs, 11
  1821. GENSYM, 13
  1822. GET, 14
  1823. GETD, 15
  1824. GETV, 21
  1825. GLOBAL, 17
  1826. global binding, 16
  1827. GLOBALP, 17
  1828. GO, 19
  1829. GREATERP, 24
  1830. id, 3, 13
  1831. identifiers, 3, 12
  1832. Standard LISP Report. 50
  1833. Index.
  1834. IDP, 10
  1835. indicator, 13
  1836. Input and output, 34
  1837. integer, 3, 12
  1838. INTERN, 13
  1839. Interpreter, 32
  1840. lambda, 6
  1841. LAMBDA expression, 6
  1842. LENGTH, 29
  1843. LESSP, 24
  1844. LINELENGTH, 34
  1845. LISP reader, 37
  1846. LIST, 11
  1847. list, 6
  1848. list-notation, 6, 36
  1849. LITER, 29
  1850. local binding, 16
  1851. LPOSN, 34
  1852. MACRO, 5
  1853. MAP, 27
  1854. MAPC, 27
  1855. MAPCAN, 27
  1856. MAPCAR, 27
  1857. MAPCON, 27
  1858. MAPLIST, 28
  1859. MAX, 25
  1860. MAX2, 25
  1861. MEMBER, 30
  1862. MEMQ, 30
  1863. MIN, 25
  1864. MINUS, 25
  1865. MIN2, 25
  1866. MKVECT, 21
  1867. NCONC, 30
  1868. NIL, 5, 38
  1869. NOEVAL functions, 7
  1870. NOSPREAD functions, 7
  1871. NOT, 22
  1872. NULL, 10
  1873. number, 5
  1874. NUMBERP, 10
  1875. object, 9, 12
  1876. OBLIST, 3, 12, 13
  1877. OPEN, 35
  1878. OR, 23
  1879. PAGELENGTH, 35
  1880. PAIR, 30
  1881. PAIRP, 10
  1882. PLUS, 25
  1883. Standard LISP Report. 51
  1884. Index.
  1885. PLUS2, 26
  1886. POSN, 35
  1887. PRINC, 35
  1888. PRINT, 35
  1889. print name, 3, 13
  1890. PRIN1, 36
  1891. PRIN2, 36
  1892. PROG, 19
  1893. PROGN, 19
  1894. Program Feature Functions, 18
  1895. properties, 3, 13
  1896. Property List Functions, 13
  1897. PUT, 14
  1898. PUTD, 16
  1899. PUTV, 21
  1900. QUOTE, 33
  1901. QUOTIENT, 26
  1902. RDS, 36
  1903. READ, 36
  1904. READCH, 36
  1905. REMAINDER, 26
  1906. REMD, 16
  1907. REMFLAG, 14
  1908. REMOB, 13
  1909. REMPROP, 14
  1910. RETURN, 20
  1911. REVERSE, 31
  1912. RPLACA, 12
  1913. RPLACD, 12
  1914. S-expression, 6
  1915. SASSOC, 31
  1916. SET, 18
  1917. SETQ, 18
  1918. SPREAD functions, 7
  1919. standard devices, 34
  1920. string, 13
  1921. STRINGP, 10
  1922. strings, 4
  1923. structures, 6
  1924. SUBLIS, 31
  1925. SUBST, 31
  1926. System GLOBAL Variables, 38
  1927. T, 5, 38
  1928. TERPRI, 36
  1929. TIMES, 26
  1930. TIMES2, 26
  1931. type mismatch error, 8
  1932. UNFLUID, 18
  1933. UPBV, 21
  1934. Standard LISP Report. 52
  1935. Index.
  1936. variable, 16
  1937. variables, 3
  1938. Variables and Bindings, 16
  1939. vector, 4
  1940. vector-notation, 4, 36
  1941. VECTORP, 10
  1942. Vectors, 21
  1943. Warning messages, 8
  1944. WRS, 37
  1945. Standard LISP Report.
  1946. TABLE OF CONTENTS
  1947. 1. Introduction .................................... 1
  1948. 2. Preliminaries ................................... 3
  1949. 2.1 Primitive Data Types ............................ 3
  1950. 2.2 Classes of Primitive Data Types ................. 5
  1951. 2.3 Structures ...................................... 6
  1952. 2.4 Function Descriptions ........................... 7
  1953. 2.5 Function Types .................................. 7
  1954. 2.6 The Extended Syntax ............................. 8
  1955. 2.7 Error and Warning Messages ...................... 8
  1956. 3. Functions ....................................... 9
  1957. 3.1 Elementary Predicates ........................... 9
  1958. 3.2 Functions on Dotted-Pairs ....................... 11
  1959. 3.3 Identifiers ..................................... 12
  1960. 3.4 Property List Functions ......................... 13
  1961. 3.5 Function Definition ............................. 15
  1962. 3.6 Variables and Bindings ......................... 16
  1963. 3.7 Program Feature Functions ....................... 18
  1964. 3.8 Error Handling .................................. 20
  1965. 3.9 Vectors ......................................... 21
  1966. 3.10 Boolean Functions and Conditionals .............. 22
  1967. 3.11 Arithmetic Functions ............................ 23
  1968. 3.12 MAP Composite Functions ......................... 27
  1969. 3.13 Composite Functions ............................. 28
  1970. 3.14 The Interpreter ................................. 32
  1971. 3.15 Input and Output ................................ 34
  1972. 3.16 LISP Reader ..................................... 37
  1973. 4. System GLOBAL Variables ......................... 38
  1974. List of References ................................... 40
  1975. Appendix A. The Extended Syntax ...................... 41
  1976. Appendix B. Alphabetical List of Functions ........... 45
  1977. Index ................................................ 48