My various dotfiles

chap-15.texi 77KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489
  1. @node Arrays, Strings, Conses, Top
  2. @chapter Arrays
  3. @menu
  4. * Array Concepts::
  5. * Arrays Dictionary::
  6. @end menu
  7. @node Array Concepts, Arrays Dictionary, Arrays, Arrays
  8. @section Array Concepts
  9. @c including concept-arrays
  10. @menu
  11. * Array Elements::
  12. * Specialized Arrays::
  13. @end menu
  14. @node Array Elements, Specialized Arrays, Array Concepts, Array Concepts
  15. @subsection Array Elements
  16. An @i{array} contains a set of @i{objects} called @i{elements}
  17. that can be referenced individually according to a rectilinear coordinate system.
  18. @menu
  19. * Array Indices::
  20. * Array Dimensions::
  21. * Implementation Limits on Individual Array Dimensions::
  22. * Array Rank::
  23. * Vectors::
  24. * Fill Pointers::
  25. * Multidimensional Arrays::
  26. * Storage Layout for Multidimensional Arrays::
  27. * Implementation Limits on Array Rank::
  28. @end menu
  29. @node Array Indices, Array Dimensions, Array Elements, Array Elements
  30. @subsubsection Array Indices
  31. An @i{array} @i{element} is referred to by a (possibly empty) series of indices.
  32. The length of the series must equal the @i{rank} of the @i{array}.
  33. Each index must be a non-negative @i{fixnum}
  34. less than the corresponding @i{array} @i{dimension}.
  35. @i{Array} indexing is zero-origin.
  36. @node Array Dimensions, Implementation Limits on Individual Array Dimensions, Array Indices, Array Elements
  37. @subsubsection Array Dimensions
  38. An axis of an @i{array} is called a @i{dimension}
  39. @IGindex{dimension}
  40. .
  41. Each @i{dimension} is a non-negative
  42. @i{fixnum};
  43. if any dimension of an @i{array} is zero, the @i{array} has no elements.
  44. It is permissible for a @i{dimension} to be zero,
  45. in which case the @i{array} has no elements,
  46. and any attempt to @i{access} an @i{element}
  47. is an error. However, other properties of the @i{array},
  48. such as the @i{dimensions} themselves, may be used.
  49. @node Implementation Limits on Individual Array Dimensions, Array Rank, Array Dimensions, Array Elements
  50. @subsubsection Implementation Limits on Individual Array Dimensions
  51. An @i{implementation} may impose a limit on @i{dimensions} of an @i{array},
  52. but there is a minimum requirement on that limit. See the @i{variable} @b{array-dimension-limit}.
  53. @node Array Rank, Vectors, Implementation Limits on Individual Array Dimensions, Array Elements
  54. @subsubsection Array Rank
  55. An @i{array} can have any number of @i{dimensions} (including zero).
  56. The number of @i{dimensions} is called the @i{rank}
  57. @IGindex{rank}
  58. .
  59. If the rank of an @i{array} is zero then the @i{array} is said to have
  60. no @i{dimensions}, and the product of the dimensions (see @b{array-total-size})
  61. is then 1; a zero-rank @i{array} therefore has a single element.
  62. @node Vectors, Fill Pointers, Array Rank, Array Elements
  63. @subsubsection Vectors
  64. An @i{array} of @i{rank} one (@i{i.e.}, a one-dimensional @i{array})
  65. is called a @i{vector}
  66. @IGindex{vector}
  67. .
  68. @node Fill Pointers, Multidimensional Arrays, Vectors, Array Elements
  69. @subsubsection Fill Pointers
  70. A @i{fill pointer}
  71. @IGindex{fill pointer}
  72. is a non-negative @i{integer} no
  73. larger than the total number of @i{elements} in a @i{vector}.
  74. Not all @i{vectors} have @i{fill pointers}.
  75. See the @i{functions} @b{make-array} and @b{adjust-array}.
  76. An @i{element} of a @i{vector} is said to be @i{active}
  77. @IGindex{active}
  78. if it has
  79. an index that is greater than or equal to zero,
  80. but less than the @i{fill pointer} (if any).
  81. For an @i{array} that has no @i{fill pointer},
  82. all @i{elements} are considered @i{active}.
  83. Only @i{vectors} may have @i{fill pointers};
  84. multidimensional @i{arrays} may not.
  85. A multidimensional @i{array} that is displaced to a @i{vector}
  86. that has a @i{fill pointer} can be created.
  87. @node Multidimensional Arrays, Storage Layout for Multidimensional Arrays, Fill Pointers, Array Elements
  88. @subsubsection Multidimensional Arrays
  89. @node Storage Layout for Multidimensional Arrays, Implementation Limits on Array Rank, Multidimensional Arrays, Array Elements
  90. @subsubsection Storage Layout for Multidimensional Arrays
  91. Multidimensional @i{arrays} store their components in row-major order;
  92. that is, internally a multidimensional @i{array} is stored as a
  93. one-dimensional @i{array}, with the multidimensional index sets
  94. ordered lexicographically, last index varying fastest.
  95. @node Implementation Limits on Array Rank, , Storage Layout for Multidimensional Arrays, Array Elements
  96. @subsubsection Implementation Limits on Array Rank
  97. An @i{implementation} may impose a limit on the @i{rank} of an @i{array},
  98. but there is a minimum requirement on that limit. See the @i{variable} @b{array-rank-limit}.
  99. @node Specialized Arrays, , Array Elements, Array Concepts
  100. @subsection Specialized Arrays
  101. An @i{array} can be a @i{general} @i{array},
  102. meaning each @i{element} may be any @i{object},
  103. or it may be a @i{specialized} @i{array},
  104. meaning that each @i{element} must be of a restricted @i{type}.
  105. The phrasing ``an @i{array} @i{specialized} to @i{type} <<@i{type}>>''
  106. is sometimes used to emphasize the @i{element type} of an @i{array}.
  107. This phrasing is tolerated even when the <<@i{type}>> is @b{t},
  108. even though an @i{array} @i{specialized} to @i{type} @i{t}
  109. is a @i{general} @i{array}, not a @i{specialized} @i{array}.
  110. Figure 15--1 lists some @i{defined names} that are applicable to @i{array}
  111. creation, @i{access}, and information operations.
  112. @group
  113. @noindent
  114. @w{ adjust-array array-in-bounds-p svref }
  115. @w{ adjustable-array-p array-rank upgraded-array-element-type }
  116. @w{ aref array-rank-limit upgraded-complex-part-type }
  117. @w{ array-dimension array-row-major-index vector }
  118. @w{ array-dimension-limit array-total-size vector-pop }
  119. @w{ array-dimensions array-total-size-limit vector-push }
  120. @w{ array-element-type fill-pointer vector-push-extend }
  121. @w{ array-has-fill-pointer-p make-array }
  122. @noindent
  123. @w{ Figure 15--1: General Purpose Array-Related Defined Names }
  124. @end group
  125. @menu
  126. * Array Upgrading::
  127. * Required Kinds of Specialized Arrays::
  128. @end menu
  129. @node Array Upgrading, Required Kinds of Specialized Arrays, Specialized Arrays, Specialized Arrays
  130. @subsubsection Array Upgrading
  131. The @i{upgraded array element type}
  132. @IGindex{upgraded array element type}
  133. of a @i{type} T_1
  134. is a @i{type} T_2 that is a @i{supertype} of T_1
  135. and that is used instead of T_1 whenever T_1
  136. is used as an @i{array element type}
  137. for object creation or type discrimination.
  138. During creation of an @i{array},
  139. the @i{element type} that was requested
  140. is called the @i{expressed array element type}
  141. @IGindex{expressed array element type}
  142. .
  143. The @i{upgraded array element type} of the @i{expressed array element type}
  144. becomes the @i{actual array element type}
  145. @IGindex{actual array element type}
  146. of the @i{array} that is created.
  147. @i{Type} @i{upgrading} implies a movement upwards in the type hierarchy lattice.
  148. A @i{type} is always a @i{subtype} of its @i{upgraded array element type}.
  149. Also, if a @i{type} T_x is a @i{subtype} of another @i{type} T_y,
  150. then
  151. the @i{upgraded array element type} of T_x
  152. must be a @i{subtype} of
  153. the @i{upgraded array element type} of T_y.
  154. Two @i{disjoint} @i{types} can be @i{upgraded} to the same @i{type}.
  155. The @i{upgraded array element type} T_2 of a @i{type} T_1
  156. is a function only of T_1 itself;
  157. that is, it is independent of any other property of the @i{array}
  158. for which T_2 will be used,
  159. such as @i{rank}, @i{adjustability}, @i{fill pointers}, or displacement.
  160. The @i{function} @b{upgraded-array-element-type}
  161. can be used by @i{conforming programs} to predict how the @i{implementation}
  162. will @i{upgrade} a given @i{type}.
  163. @node Required Kinds of Specialized Arrays, , Array Upgrading, Specialized Arrays
  164. @subsubsection Required Kinds of Specialized Arrays
  165. @i{Vectors} whose @i{elements} are restricted to @i{type}
  166. @b{character} or a @i{subtype} of @b{character}
  167. are called @i{strings}
  168. @IGindex{string}
  169. .
  170. @i{Strings} are of @i{type} @b{string}.
  171. Figure 15--2 lists some @i{defined names} related to @i{strings}.
  172. @i{Strings} are @i{specialized} @i{arrays}
  173. and might logically have been included in this chapter.
  174. However, for purposes of readability
  175. most information about @i{strings} does not appear in this chapter;
  176. see instead @ref{Strings}.
  177. @group
  178. @noindent
  179. @w{ char string-equal string-upcase }
  180. @w{ make-string string-greaterp string@t{/=} }
  181. @w{ nstring-capitalize string-left-trim string@t{<} }
  182. @w{ nstring-downcase string-lessp string@t{<=} }
  183. @w{ nstring-upcase string-not-equal string@t{=} }
  184. @w{ schar string-not-greaterp string@t{>} }
  185. @w{ string string-not-lessp string@t{>=} }
  186. @w{ string-capitalize string-right-trim }
  187. @w{ string-downcase string-trim }
  188. @noindent
  189. @w{ Figure 15--2: Operators that Manipulate Strings }
  190. @end group
  191. @i{Vectors} whose @i{elements} are restricted to @i{type}
  192. @b{bit} are called @i{bit vectors}
  193. @IGindex{bit vector}
  194. .
  195. @i{Bit vectors} are of @i{type} @b{bit-vector}.
  196. Figure 15--3 lists some @i{defined names} for operations on @i{bit arrays}.
  197. @group
  198. @noindent
  199. @w{ bit bit-ior bit-orc2 }
  200. @w{ bit-and bit-nand bit-xor }
  201. @w{ bit-andc1 bit-nor sbit }
  202. @w{ bit-andc2 bit-not }
  203. @w{ bit-eqv bit-orc1 }
  204. @noindent
  205. @w{ Figure 15--3: Operators that Manipulate Bit Arrays}
  206. @end group
  207. @c end of including concept-arrays
  208. @node Arrays Dictionary, , Array Concepts, Arrays
  209. @section Arrays Dictionary
  210. @c including dict-arrays
  211. @menu
  212. * array::
  213. * simple-array::
  214. * vector (System Class)::
  215. * simple-vector::
  216. * bit-vector::
  217. * simple-bit-vector::
  218. * make-array::
  219. * adjust-array::
  220. * adjustable-array-p::
  221. * aref::
  222. * array-dimension::
  223. * array-dimensions::
  224. * array-element-type::
  225. * array-has-fill-pointer-p::
  226. * array-displacement::
  227. * array-in-bounds-p::
  228. * array-rank::
  229. * array-row-major-index::
  230. * array-total-size::
  231. * arrayp::
  232. * fill-pointer::
  233. * row-major-aref::
  234. * upgraded-array-element-type::
  235. * array-dimension-limit::
  236. * array-rank-limit::
  237. * array-total-size-limit::
  238. * simple-vector-p::
  239. * svref::
  240. * vector::
  241. * vector-pop::
  242. * vector-push::
  243. * vectorp::
  244. * bit::
  245. * bit-and::
  246. * bit-vector-p::
  247. * simple-bit-vector-p::
  248. @end menu
  249. @node array, simple-array, Arrays Dictionary, Arrays Dictionary
  250. @subsection array [System Class]
  251. @subsubheading Class Precedence List::
  252. @b{array},
  253. @b{t}
  254. @subsubheading Description::
  255. An @i{array} contains @i{objects} arranged according to a
  256. Cartesian coordinate system.
  257. An @i{array} provides mappings from a set of
  258. @i{fixnums}
  259. \left@{i_0,i_1,\dots,i_@{r-1@}\right@} to corresponding @i{elements}
  260. of the @i{array},
  261. where 0 \le i_j < d_j,
  262. r is the rank of the array, and d_j is the size of @i{dimension} j of
  263. the array.
  264. When an @i{array} is created, the program requesting its creation may
  265. declare that all @i{elements} are of a particular @i{type},
  266. called the @i{expressed array element type}.
  267. The implementation is permitted to @i{upgrade} this type in order to
  268. produce the @i{actual array element type},
  269. which is the @i{element type} for the @i{array} is actually @i{specialized}.
  270. See the @i{function} @b{upgraded-array-element-type}.
  271. @subsubheading Compound Type Specifier Kind::
  272. Specializing.
  273. @subsubheading Compound Type Specifier Syntax::
  274. (@code{array}@{@i{@t{[}@{element-type | @b{*}@} @r{[}dimension-spec@r{]}@t{]}}@})
  275. @w{@i{dimension-spec} ::=rank | @b{*} | @r{(}@{dimension | @b{*}@}{*}@r{)}}
  276. @subsubheading Compound Type Specifier Arguments::
  277. @i{dimension}---a @i{valid array dimension}.
  278. @i{element-type}---a @i{type specifier}.
  279. @i{rank}---a non-negative @i{fixnum}.
  280. @subsubheading Compound Type Specifier Description::
  281. This denotes the set of @i{arrays} whose
  282. @i{element type}, @i{rank}, and @i{dimensions}
  283. match any given
  284. @i{element-type}, @i{rank}, and @i{dimensions}.
  285. Specifically:
  286. If @i{element-type} is the @i{symbol} @b{*},
  287. @i{arrays} are not excluded on the basis of their @i{element type}.
  288. Otherwise, only those @i{arrays} are included whose @i{actual array element type}
  289. is the result of @i{upgrading} @i{element-type};
  290. see @ref{Array Upgrading}.
  291. If the @i{dimension-spec} is a @i{rank},
  292. the set includes only those @i{arrays} having that @i{rank}.
  293. If the @i{dimension-spec} is a @i{list} of @i{dimensions},
  294. the set includes only those @i{arrays} having a @i{rank}
  295. given by the @i{length} of the @i{dimensions},
  296. and having the indicated @i{dimensions};
  297. in this case, @b{*} matches any value for the corresponding @i{dimension}.
  298. If the @i{dimension-spec} is the @i{symbol} @b{*},
  299. the set is not restricted on the basis of @i{rank} or @i{dimension}.
  300. @subsubheading See Also::
  301. @b{*print-array*},
  302. @ref{aref}
  303. ,
  304. @ref{make-array}
  305. ,
  306. @b{vector},
  307. @ref{Sharpsign A},
  308. @ref{Printing Other Arrays}
  309. @subsubheading Notes::
  310. Note that the type @t{(array t)}
  311. is a proper @i{subtype} of the type @t{(array *)}.
  312. The reason is that the type @t{(array t)} is the set of @i{arrays}
  313. that can
  314. hold any @i{object} (the @i{elements} are of @i{type} @b{t}, which includes
  315. all @i{objects}).
  316. On the other hand, the type @t{(array *)}
  317. is the set of all @i{arrays} whatsoever, including for example
  318. @i{arrays} that can hold only @i{characters}.
  319. The type @t{(array character)}
  320. is not a @i{subtype} of the type @t{(array t)};
  321. the two sets
  322. are @i{disjoint} because the type @t{(array character)} is not the
  323. set of all @i{arrays} that can hold
  324. @i{characters}, but rather the set of
  325. @i{arrays}
  326. that are specialized to hold precisely @i{characters} and no
  327. other @i{objects}.
  328. @node simple-array, vector (System Class), array, Arrays Dictionary
  329. @subsection simple-array [Type]
  330. @subsubheading Supertypes::
  331. @b{simple-array},
  332. @b{array},
  333. @b{t}
  334. @subsubheading Description::
  335. The @i{type} of an @i{array} that is not displaced
  336. to another @i{array}, has no @i{fill pointer}, and is
  337. not
  338. @i{expressly adjustable} is a @i{subtype} of @i{type} @b{simple-array}.
  339. The concept of a @i{simple array}
  340. exists to allow the implementation to use a specialized representation
  341. and to allow the user to declare that certain values will always be
  342. @i{simple arrays}.
  343. The @i{types} @b{simple-vector},
  344. @b{simple-string},
  345. and @b{simple-bit-vector}
  346. are @i{disjoint} @i{subtypes} of @i{type} @b{simple-array},
  347. for they respectively mean @t{(simple-array t (*))},
  348. the union of all @t{(simple-array @i{c} (*))}
  349. for any @i{c} being a @i{subtype} of @i{type} @b{character},
  350. and @t{(simple-array bit (*))}.
  351. @subsubheading Compound Type Specifier Kind::
  352. Specializing.
  353. @subsubheading Compound Type Specifier Syntax::
  354. (@code{simple-array}@{@i{@t{[}@{element-type | @b{*}@} @r{[}dimension-spec@r{]}@t{]}}@})
  355. @w{@i{dimension-spec} ::=rank | @b{*} | @r{(}@{dimension | @b{*}@}{*}@r{)}}
  356. @subsubheading Compound Type Specifier Arguments::
  357. @i{dimension}---a @i{valid array dimension}.
  358. @i{element-type}---a @i{type specifier}.
  359. @i{rank}---a non-negative @i{fixnum}.
  360. @subsubheading Compound Type Specifier Description::
  361. This @i{compound type specifier} is treated exactly as the corresponding
  362. @i{compound type specifier} for @i{type} @b{array} would be treated,
  363. except that the set is further constrained to include only @i{simple arrays}.
  364. @subsubheading Notes::
  365. It is @i{implementation-dependent}
  366. whether @i{displaced arrays},
  367. @i{vectors} with @i{fill pointers},
  368. or arrays that are @i{actually adjustable}
  369. are @i{simple arrays}.
  370. @t{(simple-array *)} refers to all @i{simple arrays}
  371. regardless of element type, @t{(simple-array @i{type-specifier})}
  372. refers only to those @i{simple arrays}
  373. that can result from giving @i{type-specifier} as the
  374. @t{:element-type} argument to @b{make-array}.
  375. @node vector (System Class), simple-vector, simple-array, Arrays Dictionary
  376. @subsection vector [System Class]
  377. @subsubheading Class Precedence List::
  378. @b{vector},
  379. @b{array},
  380. @b{sequence},
  381. @b{t}
  382. @subsubheading Description::
  383. Any one-dimensional @i{array} is a @i{vector}.
  384. The @i{type} @b{vector} is a @i{subtype} of @i{type} @b{array};
  385. for all @i{types} @t{x}, @t{(vector x)} is the same as @t{(array x (*))}.
  386. The @i{type} @t{(vector t)}, the @i{type} @b{string}, and the @i{type} @b{bit-vector}
  387. are @i{disjoint} @i{subtypes} of @i{type} @b{vector}.
  388. @subsubheading Compound Type Specifier Kind::
  389. Specializing.
  390. @subsubheading Compound Type Specifier Syntax::
  391. (@code{vector}@{@i{@t{[}@{element-type | @b{*}@} @r{[}@{size | @b{*}@}{]}@t{]}}@})
  392. @subsubheading Compound Type Specifier Arguments::
  393. @i{size}---a non-negative @i{fixnum}.
  394. @i{element-type}---a @i{type specifier}.
  395. @subsubheading Compound Type Specifier Description::
  396. This denotes the set of specialized @i{vectors}
  397. whose @i{element type} and @i{dimension} match the specified values.
  398. Specifically:
  399. If @i{element-type} is the @i{symbol} @b{*},
  400. @i{vectors} are not excluded on the basis of their @i{element type}.
  401. Otherwise, only those @i{vectors} are included whose @i{actual array element type}
  402. is the result of @i{upgrading} @i{element-type};
  403. see @ref{Array Upgrading}.
  404. If a @i{size} is specified,
  405. the set includes only those @i{vectors} whose only @i{dimension}
  406. is @i{size}.
  407. If the @i{symbol} @b{*} is specified instead of a @i{size},
  408. the set is not restricted on the basis of @i{dimension}.
  409. @subsubheading See Also::
  410. @ref{Required Kinds of Specialized Arrays},
  411. @ref{Sharpsign Left-Parenthesis},
  412. @ref{Printing Other Vectors},
  413. @ref{Sharpsign A}
  414. @subsubheading Notes::
  415. The @i{type} @t{(vector @i{e} @i{s})}
  416. is equivalent to the @i{type} @t{(array @i{e} (@i{s}))}.
  417. The type @t{(vector bit)} has the name @b{bit-vector}.
  418. The union of all @i{types} @t{(vector C)},
  419. where C is any @i{subtype} of @b{character},
  420. has the name @b{string}.
  421. @t{(vector *)} refers to all @i{vectors}
  422. regardless of element type, @t{(vector @i{type-specifier})}
  423. refers only to those @i{vectors}
  424. that can result from giving @i{type-specifier} as the
  425. @t{:element-type} argument to @b{make-array}.
  426. @node simple-vector, bit-vector, vector (System Class), Arrays Dictionary
  427. @subsection simple-vector [Type]
  428. @subsubheading Supertypes::
  429. @b{simple-vector},
  430. @b{vector},
  431. @b{simple-array},
  432. @b{array},
  433. @b{sequence},
  434. @b{t}
  435. @subsubheading Description::
  436. The @i{type} of a @i{vector} that is not displaced to another
  437. @i{array}, has no @i{fill pointer}, is not
  438. @i{expressly adjustable}
  439. and is able to hold
  440. elements of any @i{type} is a @i{subtype} of @i{type} @b{simple-vector}.
  441. The @i{type} @b{simple-vector} is a @i{subtype} of @i{type} @b{vector},
  442. and is a @i{subtype} of @i{type} @t{(vector t)}.
  443. @subsubheading Compound Type Specifier Kind::
  444. Specializing.
  445. @subsubheading Compound Type Specifier Syntax::
  446. (@code{simple-vector}@{@i{@t{[}size@t{]}}@})
  447. @subsubheading Compound Type Specifier Arguments::
  448. @i{size}---a non-negative @i{fixnum},
  449. or the @i{symbol} @b{*}.
  450. The default is the @i{symbol} @b{*}.
  451. @subsubheading Compound Type Specifier Description::
  452. This is the same as @t{(simple-array t (@i{size}))}.
  453. @node bit-vector, simple-bit-vector, simple-vector, Arrays Dictionary
  454. @subsection bit-vector [System Class]
  455. @subsubheading Class Precedence List::
  456. @b{bit-vector},
  457. @b{vector},
  458. @b{array},
  459. @b{sequence},
  460. @b{t}
  461. @subsubheading Description::
  462. A @i{bit vector} is a @i{vector} the @i{element type} of which is @i{bit}.
  463. The @i{type} @b{bit-vector} is a @i{subtype} of @i{type} @b{vector},
  464. for @b{bit-vector} means @t{(vector bit)}.
  465. @subsubheading Compound Type Specifier Kind::
  466. Abbreviating.
  467. @subsubheading Compound Type Specifier Syntax::
  468. (@code{bit-vector}@{@i{@t{[}size@t{]}}@})
  469. @subsubheading Compound Type Specifier Arguments::
  470. @i{size}---a non-negative @i{fixnum},
  471. or the @i{symbol} @b{*}.
  472. @subsubheading Compound Type Specifier Description::
  473. This denotes the same @i{type} as the @i{type} @t{(array bit (@i{size}))};
  474. that is, the set of @i{bit vectors} of size @i{size}.
  475. @subsubheading See Also::
  476. @ref{Sharpsign Asterisk},
  477. @ref{Printing Bit Vectors},
  478. @ref{Required Kinds of Specialized Arrays}
  479. @node simple-bit-vector, make-array, bit-vector, Arrays Dictionary
  480. @subsection simple-bit-vector [Type]
  481. @subsubheading Supertypes::
  482. @b{simple-bit-vector},
  483. @b{bit-vector},
  484. @b{vector},
  485. @b{simple-array},
  486. @b{array},
  487. @b{sequence},
  488. @b{t}
  489. @subsubheading Description::
  490. The @i{type} of a @i{bit vector} that is not displaced
  491. to another @i{array}, has no @i{fill pointer}, and is
  492. not
  493. @i{expressly adjustable}
  494. is a
  495. @i{subtype} of @i{type} @b{simple-bit-vector}.
  496. @subsubheading Compound Type Specifier Kind::
  497. Abbreviating.
  498. @subsubheading Compound Type Specifier Syntax::
  499. (@code{simple-bit-vector}@{@i{@t{[}size@t{]}}@})
  500. @subsubheading Compound Type Specifier Arguments::
  501. @i{size}---a non-negative @i{fixnum},
  502. or the @i{symbol} @b{*}.
  503. The default is the @i{symbol} @b{*}.
  504. @subsubheading Compound Type Specifier Description::
  505. This denotes the same type as the @i{type}
  506. @t{(simple-array bit (@i{size}))};
  507. that is, the set of @i{simple bit vectors} of size @i{size}.
  508. @node make-array, adjust-array, simple-bit-vector, Arrays Dictionary
  509. @subsection make-array [Function]
  510. @code{make-array} @i{dimensions {&key} element-type
  511. initial-element
  512. initial-contents
  513. adjustable
  514. fill-pointer
  515. displaced-to
  516. displaced-index-offset}@*
  517. @result{} @i{new-array}
  518. @subsubheading Arguments and Values::
  519. @i{dimensions}---a @i{designator} for a @i{list} of @i{valid array dimensions}.
  520. @i{element-type}---a @i{type specifier}.
  521. The default is @b{t}.
  522. @i{initial-element}---an @i{object}.
  523. @i{initial-contents}---an @i{object}.
  524. @i{adjustable}---a @i{generalized boolean}.
  525. The default is @b{nil}.
  526. @i{fill-pointer}---a @i{valid fill pointer} for the @i{array} to be created,
  527. or @b{t} or @b{nil}.
  528. The default is @b{nil}.
  529. @i{displaced-to}---an @i{array} or @b{nil}.
  530. The default is @b{nil}.
  531. This option must not be supplied if either @i{initial-element}
  532. or @i{initial-contents} is supplied.
  533. @i{displaced-index-offset}---a @i{valid array row-major index}
  534. for @i{displaced-to}. The default is @t{0}.
  535. This option must not be supplied unless a @i{non-nil} @i{displaced-to} is supplied.
  536. @i{new-array}---an @i{array}.
  537. @subsubheading Description::
  538. Creates and returns an @i{array} constructed of the most @i{specialized}
  539. @i{type} that can accommodate elements of @i{type} given by @i{element-type}.
  540. If @i{dimensions} is @b{nil} then a zero-dimensional @i{array} is created.
  541. @i{Dimensions} represents the dimensionality of the new @i{array}.
  542. @i{element-type} indicates the @i{type} of the elements intended to be stored
  543. in the @i{new-array}. The @i{new-array} can actually store any @i{objects}
  544. of the @i{type} which results from @i{upgrading} @i{element-type};
  545. see @ref{Array Upgrading}.
  546. If @i{initial-element} is supplied,
  547. it is used to initialize each @i{element} of @i{new-array}.
  548. If @i{initial-element} is supplied,
  549. it must be of the @i{type} given by @i{element-type}.
  550. @i{initial-element} cannot be supplied if either the @t{:initial-contents} option
  551. is supplied or @i{displaced-to} is @i{non-nil}.
  552. If @i{initial-element} is not supplied,
  553. the consequences of later reading an uninitialized @i{element} of @i{new-array}
  554. are undefined
  555. unless either @i{initial-contents} is supplied
  556. or @i{displaced-to} is @i{non-nil}.
  557. @i{initial-contents} is used to initialize the contents of @i{array}.
  558. For example:
  559. @example
  560. (make-array '(4 2 3) :initial-contents
  561. '(((a b c) (1 2 3))
  562. ((d e f) (3 1 2))
  563. ((g h i) (2 3 1))
  564. ((j k l) (0 0 0))))
  565. @end example
  566. @i{initial-contents} is composed of a nested structure of @i{sequences}.
  567. The numbers of levels in the structure must equal the rank of @i{array}.
  568. Each leaf of the nested structure must be of the @i{type} given by @i{element-type}.
  569. If @i{array} is zero-dimensional, then @i{initial-contents} specifies the single
  570. @i{element}. Otherwise, @i{initial-contents} must be a @i{sequence}
  571. whose length is equal to the first dimension; each element must be a nested
  572. structure for an @i{array} whose dimensions are the remaining dimensions,
  573. and so on.
  574. @i{Initial-contents} cannot be supplied if either
  575. @i{initial-element} is supplied
  576. or @i{displaced-to} is @i{non-nil}.
  577. If @i{initial-contents} is not supplied,
  578. the consequences of later reading an uninitialized @i{element} of @i{new-array}
  579. are undefined
  580. unless either @i{initial-element} is supplied
  581. or @i{displaced-to} is @i{non-nil}.
  582. If @i{adjustable} is @i{non-nil},
  583. the array is @i{expressly adjustable}
  584. (and so @i{actually adjustable});
  585. otherwise, the array is not @i{expressly adjustable}
  586. (and it is @i{implementation-dependent} whether
  587. the array is @i{actually adjustable}).
  588. If @i{fill-pointer} is @i{non-nil},
  589. the @i{array} must be one-dimensional;
  590. that is, the @i{array} must be a @i{vector}.
  591. If @i{fill-pointer} is @b{t},
  592. the length of the @i{vector} is used to initialize the @i{fill pointer}.
  593. If @i{fill-pointer} is an @i{integer},
  594. it becomes the initial @i{fill pointer} for the @i{vector}.
  595. If @i{displaced-to} is @i{non-nil},
  596. @b{make-array} will create a @i{displaced array}
  597. and @i{displaced-to} is the @i{target} of that @i{displaced array}.
  598. In that case, the consequences are undefined if the @i{actual array element type} of
  599. @i{displaced-to} is not @i{type equivalent} to the @i{actual array element type}
  600. of the @i{array} being created.
  601. If @i{displaced-to} is @b{nil}, the @i{array} is not a @i{displaced array}.
  602. The @i{displaced-index-offset} is made to be the index offset of the @i{array}.
  603. When an array A is given as
  604. the @t{:displaced-to} @i{argument} to @b{make-array}
  605. when creating array B,
  606. then array B is said to be displaced to array A. The
  607. total number of elements in an @i{array},
  608. called the total size of the @i{array},
  609. is calculated as the product of all the dimensions.
  610. It is required that the total size of A be no smaller than the sum
  611. of the total size of B plus the offset @t{n} supplied by
  612. the @i{displaced-index-offset}.
  613. The effect of displacing is that array B does not have any
  614. elements of its own, but instead maps @i{accesses} to itself into
  615. @i{accesses} to array A. The mapping treats both @i{arrays} as if they
  616. were one-dimensional by taking the elements in row-major order,
  617. and then maps an @i{access} to element @t{k} of array B to an @i{access} to element
  618. @t{k}+@t{n} of array A.
  619. If @b{make-array} is called with @i{adjustable}, @i{fill-pointer},
  620. and @i{displaced-to} each @b{nil},
  621. then the result is a @i{simple array}.
  622. If @b{make-array} is called with one or more of @i{adjustable},
  623. @i{fill-pointer}, or @i{displaced-to} being @i{true}, whether the
  624. resulting @i{array} is a @i{simple array} is @i{implementation-dependent}.
  625. When an array A is given as the @t{:displaced-to} @i{argument} to
  626. @b{make-array} when creating array B, then array B is said to
  627. be displaced to array A. The total number of elements in an @i{array},
  628. called the total size of the @i{array}, is calculated as the product
  629. of all the dimensions.
  630. The consequences are unspecified if
  631. the total size of A is smaller than the sum
  632. of the total size of B plus the offset @t{n} supplied by
  633. the @i{displaced-index-offset}.
  634. The effect of displacing is that array B does not have any
  635. elements of its own, but instead maps @i{accesses} to itself into
  636. @i{accesses} to array A. The mapping treats both @i{arrays} as if they
  637. were one-dimensional by taking the elements in row-major order,
  638. and then maps an @i{access} to element @t{k} of array B to an @i{access}
  639. to @i{element} @t{k}+@t{n} of array A.
  640. @subsubheading Examples::
  641. @example
  642. (make-array 5) ;; Creates a one-dimensional array of five elements.
  643. (make-array '(3 4) :element-type '(mod 16)) ;; Creates a
  644. ;;two-dimensional array, 3 by 4, with four-bit elements.
  645. (make-array 5 :element-type 'single-float) ;; Creates an array of single-floats.
  646. @end example
  647. @example
  648. (make-array nil :initial-element nil) @result{} #0ANIL
  649. (make-array 4 :initial-element nil) @result{} #(NIL NIL NIL NIL)
  650. (make-array '(2 4)
  651. :element-type '(unsigned-byte 2)
  652. :initial-contents '((0 1 2 3) (3 2 1 0)))
  653. @result{} #2A((0 1 2 3) (3 2 1 0))
  654. (make-array 6
  655. :element-type 'character
  656. :initial-element #\a
  657. :fill-pointer 3) @result{} "aaa"
  658. @end example
  659. The following is an example of making a @i{displaced array}.
  660. @example
  661. (setq a (make-array '(4 3)))
  662. @result{} #<ARRAY 4x3 simple 32546632>
  663. (dotimes (i 4)
  664. (dotimes (j 3)
  665. (setf (aref a i j) (list i 'x j '= (* i j)))))
  666. @result{} NIL
  667. (setq b (make-array 8 :displaced-to a
  668. :displaced-index-offset 2))
  669. @result{} #<ARRAY 8 indirect 32550757>
  670. (dotimes (i 8)
  671. (print (list i (aref b i))))
  672. @t{ |> } (0 (0 X 2 = 0))
  673. @t{ |> } (1 (1 X 0 = 0))
  674. @t{ |> } (2 (1 X 1 = 1))
  675. @t{ |> } (3 (1 X 2 = 2))
  676. @t{ |> } (4 (2 X 0 = 0))
  677. @t{ |> } (5 (2 X 1 = 2))
  678. @t{ |> } (6 (2 X 2 = 4))
  679. @t{ |> } (7 (3 X 0 = 0))
  680. @result{} NIL
  681. @end example
  682. The last example depends on the fact that @i{arrays} are, in effect,
  683. stored in row-major order.
  684. @example
  685. (setq a1 (make-array 50))
  686. @result{} #<ARRAY 50 simple 32562043>
  687. (setq b1 (make-array 20 :displaced-to a1 :displaced-index-offset 10))
  688. @result{} #<ARRAY 20 indirect 32563346>
  689. (length b1) @result{} 20
  690. (setq a2 (make-array 50 :fill-pointer 10))
  691. @result{} #<ARRAY 50 fill-pointer 10 46100216>
  692. (setq b2 (make-array 20 :displaced-to a2 :displaced-index-offset 10))
  693. @result{} #<ARRAY 20 indirect 46104010>
  694. (length a2) @result{} 10
  695. (length b2) @result{} 20
  696. (setq a3 (make-array 50 :fill-pointer 10))
  697. @result{} #<ARRAY 50 fill-pointer 10 46105663>
  698. (setq b3 (make-array 20 :displaced-to a3 :displaced-index-offset 10
  699. :fill-pointer 5))
  700. @result{} #<ARRAY 20 indirect, fill-pointer 5 46107432>
  701. (length a3) @result{} 10
  702. (length b3) @result{} 5
  703. @end example
  704. @subsubheading See Also::
  705. @ref{adjustable-array-p}
  706. ,
  707. @ref{aref}
  708. ,
  709. @ref{arrayp}
  710. ,
  711. @ref{array-element-type}
  712. ,
  713. @ref{array-rank-limit}
  714. ,
  715. @ref{array-dimension-limit}
  716. ,
  717. @ref{fill-pointer}
  718. ,
  719. @ref{upgraded-array-element-type}
  720. @subsubheading Notes::
  721. There is no specified way to create an @i{array}
  722. for which @b{adjustable-array-p} definitely
  723. returns @i{false}.
  724. There is no specified way to create an @i{array}
  725. that is not a @i{simple array}.
  726. @node adjust-array, adjustable-array-p, make-array, Arrays Dictionary
  727. @subsection adjust-array [Function]
  728. @code{adjust-array} @i{array new-dimensions {&key} element-type
  729. initial-element
  730. initial-contents
  731. fill-pointer
  732. displaced-to
  733. displaced-index-offset}@*
  734. @result{} @i{adjusted-array}
  735. @subsubheading Arguments and Values::
  736. @i{array}---an @i{array}.
  737. @i{new-dimensions}---a @i{valid array dimension}
  738. or a @i{list} of @i{valid array dimensions}.
  739. @i{element-type}---a @i{type specifier}.
  740. @i{initial-element}---an @i{object}.
  741. @i{Initial-element} must not be supplied if either
  742. @i{initial-contents} or @i{displaced-to} is supplied.
  743. @i{initial-contents}---an @i{object}.
  744. If @i{array} has rank greater than zero, then @i{initial-contents}
  745. is composed of nested @i{sequences}, the depth of which must equal
  746. the rank of @i{array}. Otherwise, @i{array} is zero-dimensional and
  747. @i{initial-contents} supplies the single element.
  748. @i{initial-contents} must not be supplied if either
  749. @i{initial-element} or @i{displaced-to} is given.
  750. @i{fill-pointer}---a @i{valid fill pointer} for the
  751. @i{array} to be created, or @b{t}, or @b{nil}.
  752. The default is @b{nil}.
  753. @i{displaced-to}---an @i{array} or @b{nil}.
  754. @i{initial-elements} and @i{initial-contents} must not be supplied
  755. if @i{displaced-to} is supplied.
  756. @i{displaced-index-offset}---an @i{object} of @i{type} @t{(fixnum 0 @i{n})}
  757. where @i{n} is @t{(array-total-size @i{displaced-to})}.
  758. @i{displaced-index-offset} may be supplied only if @i{displaced-to} is supplied.
  759. @i{adjusted-array}---an @i{array}.
  760. @subsubheading Description::
  761. @b{adjust-array} changes the dimensions or elements of @i{array}.
  762. The result is an @i{array} of the same @i{type} and rank as @i{array},
  763. that is either the modified @i{array},
  764. or a newly created @i{array} to which
  765. @i{array} can be displaced, and that has
  766. the given @i{new-dimensions}.
  767. @i{New-dimensions} specify the size of each @i{dimension} of @i{array}.
  768. @i{Element-type} specifies the @i{type} of the @i{elements}
  769. of the resulting @i{array}. If @i{element-type} is supplied,
  770. the consequences are unspecified if
  771. the @i{upgraded array element type} of @i{element-type}
  772. is not the same as the @i{actual array element type} of @i{array}.
  773. If @i{initial-contents} is supplied, it is treated as for
  774. @b{make-array}. In this case none of the original contents of
  775. @i{array} appears in the resulting @i{array}.
  776. If @i{fill-pointer} is an @i{integer},
  777. it becomes the @i{fill pointer} for the resulting @i{array}.
  778. If @i{fill-pointer} is the symbol @b{t},
  779. it indicates that the size of the resulting @i{array}
  780. should be used as the @i{fill pointer}.
  781. If @i{fill-pointer} is @b{nil},
  782. it indicates that the @i{fill pointer} should be left as it is.
  783. If @i{displaced-to}
  784. @i{non-nil}, a @i{displaced array}
  785. is created. The resulting @i{array} shares its contents with the @i{array} given by
  786. @i{displaced-to}.
  787. The resulting @i{array} cannot contain more elements than the @i{array}
  788. it is displaced to.
  789. If @i{displaced-to} is not supplied or @b{nil},
  790. the resulting @i{array} is not a @i{displaced array}.
  791. If array A is created displaced to array B and subsequently
  792. array B is given to @b{adjust-array}, array A will still be
  793. displaced to array B.
  794. Although @i{array} might be a @i{displaced array},
  795. the resulting @i{array} is not a @i{displaced array} unless
  796. @i{displaced-to} is supplied and not @b{nil}.
  797. The interaction between @b{adjust-array} and
  798. displaced @i{arrays}
  799. is as follows given three @i{arrays}, @t{A}, @t{B}, and~@t{C}:
  800. @table @asis
  801. @item @t{A} is not displaced before or after the call
  802. @example
  803. (adjust-array A ...)
  804. @end example
  805. The dimensions of @t{A} are altered, and the
  806. contents rearranged as appropriate.
  807. Additional elements of @t{A} are taken from
  808. @i{initial-element}.
  809. The use of @i{initial-contents} causes all old contents to be
  810. discarded.
  811. @item @t{A} is not displaced before, but is displaced to
  812. @t{C} after the call
  813. @example
  814. (adjust-array A ... :displaced-to C)
  815. @end example
  816. None of the original contents of @t{A} appears in
  817. @t{A} afterwards; @t{A} now contains
  818. the contents of @t{C}, without any rearrangement of @t{C}.
  819. @item @t{A} is displaced to @t{B}
  820. before the call, and is displaced to @t{C} after
  821. the call
  822. @example
  823. (adjust-array A ... :displaced-to B)
  824. (adjust-array A ... :displaced-to C)
  825. @end example
  826. @t{B} and @t{C} might be the same. The contents of @t{B} do not appear in
  827. @t{A} afterward unless such contents also happen to be in @t{C} If
  828. @i{displaced-index-offset}
  829. is not supplied in the @b{adjust-array} call, it defaults
  830. to zero; the old offset into @t{B} is not retained.
  831. @item @t{A} is displaced to @t{B} before the call, but not displaced
  832. afterward.
  833. @example
  834. (adjust-array A ... :displaced-to B)
  835. (adjust-array A ... :displaced-to nil)
  836. @end example
  837. @t{A} gets a
  838. new ``data region,'' and contents of @t{B} are copied into it as appropriate to
  839. maintain the existing old contents; additional elements of @t{A}
  840. are taken from
  841. @i{initial-element} if supplied. However,
  842. the use of @i{initial-contents} causes all old contents
  843. to be discarded.
  844. @end table
  845. If @i{displaced-index-offset} is supplied,
  846. it specifies the offset
  847. of the resulting @i{array} from the beginning of
  848. the @i{array} that it is displaced to.
  849. If @i{displaced-index-offset} is not supplied, the offset is~0.
  850. The size of the resulting @i{array} plus the
  851. offset value cannot exceed the size of
  852. the @i{array} that it is displaced to.
  853. If only @i{new-dimensions}
  854. and an @i{initial-element} argument are supplied,
  855. those elements of @i{array} that
  856. are still in bounds appear in the resulting @i{array}. The elements of
  857. the resulting @i{array} that are not in the bounds of
  858. @i{array} are initialized
  859. to @i{initial-element}; if @i{initial-element} is not provided,
  860. the consequences of later reading any such new @i{element} of @i{new-array}
  861. before it has been initialized
  862. are undefined.
  863. If @i{initial-contents} or @i{displaced-to} is supplied,
  864. then none of the original contents of @i{array} appears in the new @i{array}.
  865. The consequences are unspecified if @i{array} is adjusted
  866. to a size smaller than its @i{fill pointer} without supplying
  867. the @i{fill-pointer} argument so that its @i{fill-pointer}
  868. is properly adjusted in the process.
  869. If @t{A} is displaced to @t{B}, the consequences are unspecified
  870. if @t{B} is adjusted in such a way that it no longer has enough elements
  871. to satisfy @t{A}.
  872. If @b{adjust-array} is applied to an @i{array} that is @i{actually adjustable},
  873. the @i{array} returned is @i{identical} to @i{array}.
  874. If the @i{array} returned by @b{adjust-array}
  875. is @i{distinct} from @i{array}, then the argument @i{array} is unchanged.
  876. Note that if an @i{array} A is displaced to another @i{array} B,
  877. and B is displaced to another @i{array} C, and B is altered by
  878. @b{adjust-array}, A must now refer to the adjust contents of B.
  879. This means that an implementation cannot collapse the chain to make A
  880. refer to C directly and forget that the chain of reference passes through
  881. B. However, caching techniques are permitted as long as they preserve the
  882. semantics specified here.
  883. @subsubheading Examples::
  884. @example
  885. (adjustable-array-p
  886. (setq ada (adjust-array
  887. (make-array '(2 3)
  888. :adjustable t
  889. :initial-contents '((a b c) (1 2 3)))
  890. '(4 6)))) @result{} T
  891. (array-dimensions ada) @result{} (4 6)
  892. (aref ada 1 1) @result{} 2
  893. (setq beta (make-array '(2 3) :adjustable t))
  894. @result{} #2A((NIL NIL NIL) (NIL NIL NIL))
  895. (adjust-array beta '(4 6) :displaced-to ada)
  896. @result{} #2A((A B C NIL NIL NIL)
  897. (1 2 3 NIL NIL NIL)
  898. (NIL NIL NIL NIL NIL NIL)
  899. (NIL NIL NIL NIL NIL NIL))
  900. (array-dimensions beta) @result{} (4 6)
  901. (aref beta 1 1) @result{} 2
  902. @end example
  903. Suppose that the 4-by-4 array in @t{m} looks like this:
  904. @example
  905. #2A(( alpha beta gamma delta )
  906. ( epsilon zeta eta theta )
  907. ( iota kappa lambda mu )
  908. ( nu xi omicron pi ))
  909. @end example
  910. Then the result of
  911. @example
  912. (adjust-array m '(3 5) :initial-element 'baz)
  913. @end example
  914. is a 3-by-5 array with contents
  915. @example
  916. #2A(( alpha beta gamma delta baz )
  917. ( epsilon zeta eta theta baz )
  918. ( iota kappa lambda mu baz ))
  919. @end example
  920. @subsubheading Exceptional Situations::
  921. An error of @i{type} @b{error} is signaled if @i{fill-pointer} is supplied
  922. and @i{non-nil} but @i{array} has no @i{fill pointer}.
  923. @subsubheading See Also::
  924. @ref{adjustable-array-p}
  925. ,
  926. @ref{make-array}
  927. ,
  928. @ref{array-dimension-limit}
  929. ,
  930. @ref{array-total-size-limit}
  931. ,
  932. @b{array}
  933. @node adjustable-array-p, aref, adjust-array, Arrays Dictionary
  934. @subsection adjustable-array-p [Function]
  935. @code{adjustable-array-p} @i{array} @result{} @i{generalized-boolean}
  936. @subsubheading Arguments and Values::
  937. @i{array}---an @i{array}.
  938. @i{generalized-boolean}---a @i{generalized boolean}.
  939. @subsubheading Description::
  940. Returns true if and only if @b{adjust-array} could return a @i{value}
  941. which is @i{identical} to @i{array} when given that @i{array} as its
  942. first @i{argument}.
  943. @subsubheading Examples::
  944. @example
  945. (adjustable-array-p
  946. (make-array 5
  947. :element-type 'character
  948. :adjustable t
  949. :fill-pointer 3)) @result{} @i{true}
  950. (adjustable-array-p (make-array 4)) @result{} @i{implementation-dependent}
  951. @end example
  952. @subsubheading Exceptional Situations::
  953. Should signal an error of @i{type} @b{type-error} if its argument is not an @i{array}.
  954. @subsubheading See Also::
  955. @ref{adjust-array}
  956. ,
  957. @ref{make-array}
  958. @node aref, array-dimension, adjustable-array-p, Arrays Dictionary
  959. @subsection aref [Accessor]
  960. @code{aref} @i{array {&rest} subscripts} @result{} @i{element}
  961. (setf (@code{ aref} @i{array {&rest} subscripts}) new-element)@*
  962. @subsubheading Arguments and Values::
  963. @i{array}---an @i{array}.
  964. @i{subscripts}---a @i{list} of @i{valid array indices} for the @i{array}.
  965. @i{element}, @i{new-element}---an @i{object}.
  966. @subsubheading Description::
  967. @i{Accesses} the @i{array} @i{element} specified by the @i{subscripts}.
  968. If no @i{subscripts} are supplied and @i{array} is zero rank,
  969. @b{aref} @i{accesses} the sole element of @i{array}.
  970. @b{aref} ignores @i{fill pointers}.
  971. It is permissible to use @b{aref}
  972. to @i{access} any @i{array} @i{element},
  973. whether @i{active} or not.
  974. @subsubheading Examples::
  975. If the variable @t{foo} names a 3-by-5 array,
  976. then the first index could be 0, 1, or 2, and then second index
  977. could be 0, 1, 2, 3, or 4. The array elements can be referred to by using
  978. the @i{function} @b{aref}; for example, @t{(aref foo 2 1)}
  979. refers to element (2, 1) of the array.
  980. @example
  981. (aref (setq alpha (make-array 4)) 3) @result{} @i{implementation-dependent}
  982. (setf (aref alpha 3) 'sirens) @result{} SIRENS
  983. (aref alpha 3) @result{} SIRENS
  984. (aref (setq beta (make-array '(2 4)
  985. :element-type '(unsigned-byte 2)
  986. :initial-contents '((0 1 2 3) (3 2 1 0))))
  987. 1 2) @result{} 1
  988. (setq gamma '(0 2))
  989. (apply #'aref beta gamma) @result{} 2
  990. (setf (apply #'aref beta gamma) 3) @result{} 3
  991. (apply #'aref beta gamma) @result{} 3
  992. (aref beta 0 2) @result{} 3
  993. @end example
  994. @subsubheading See Also::
  995. @ref{bit}
  996. ,
  997. @ref{char; schar}
  998. ,
  999. @ref{elt}
  1000. ,
  1001. @ref{row-major-aref}
  1002. ,
  1003. @ref{svref}
  1004. ,
  1005. @ref{Compiler Terminology}
  1006. @node array-dimension, array-dimensions, aref, Arrays Dictionary
  1007. @subsection array-dimension [Function]
  1008. @code{array-dimension} @i{array axis-number} @result{} @i{dimension}
  1009. @subsubheading Arguments and Values::
  1010. @i{array}---an @i{array}.
  1011. @i{axis-number}---an @i{integer} greater than or equal to zero
  1012. and less than the @i{rank} of the @i{array}.
  1013. @i{dimension}---a non-negative @i{integer}.
  1014. @subsubheading Description::
  1015. @b{array-dimension} returns the @i{axis-number}
  1016. @i{dimension}_1 of @i{array}.
  1017. (Any @i{fill pointer} is ignored.)
  1018. @subsubheading Examples::
  1019. @example
  1020. (array-dimension (make-array 4) 0) @result{} 4
  1021. (array-dimension (make-array '(2 3)) 1) @result{} 3
  1022. @end example
  1023. @subsubheading Affected By::
  1024. None.
  1025. @subsubheading See Also::
  1026. @ref{array-dimensions}
  1027. ,
  1028. @ref{length}
  1029. @subsubheading Notes::
  1030. @example
  1031. (array-dimension array n) @equiv{} (nth n (array-dimensions array))
  1032. @end example
  1033. @node array-dimensions, array-element-type, array-dimension, Arrays Dictionary
  1034. @subsection array-dimensions [Function]
  1035. @code{array-dimensions} @i{array} @result{} @i{dimensions}
  1036. @subsubheading Arguments and Values::
  1037. @i{array}---an @i{array}.
  1038. @i{dimensions}---a @i{list} of @i{integers}.
  1039. @subsubheading Description::
  1040. Returns a @i{list} of the @i{dimensions} of @i{array}.
  1041. (If @i{array} is a @i{vector} with a @i{fill pointer},
  1042. that @i{fill pointer} is ignored.)
  1043. @subsubheading Examples::
  1044. @example
  1045. (array-dimensions (make-array 4)) @result{} (4)
  1046. (array-dimensions (make-array '(2 3))) @result{} (2 3)
  1047. (array-dimensions (make-array 4 :fill-pointer 2)) @result{} (4)
  1048. @end example
  1049. @subsubheading Exceptional Situations::
  1050. Should signal an error of @i{type} @b{type-error} if its argument is not an @i{array}.
  1051. @subsubheading See Also::
  1052. @ref{array-dimension}
  1053. @node array-element-type, array-has-fill-pointer-p, array-dimensions, Arrays Dictionary
  1054. @subsection array-element-type [Function]
  1055. @code{array-element-type} @i{array} @result{} @i{typespec}
  1056. @subsubheading Arguments and Values::
  1057. @i{array}---an @i{array}.
  1058. @i{typespec}---a @i{type specifier}.
  1059. @subsubheading Description::
  1060. Returns a @i{type specifier} which represents the @i{actual array element type}
  1061. of the array, which is the set of @i{objects} that such an @i{array} can hold.
  1062. (Because of @i{array} @i{upgrading}, this @i{type specifier} can in
  1063. some cases denote a @i{supertype} of the @i{expressed array element type}
  1064. of the @i{array}.)
  1065. @subsubheading Examples::
  1066. @example
  1067. (array-element-type (make-array 4)) @result{} T
  1068. (array-element-type (make-array 12 :element-type '(unsigned-byte 8)))
  1069. @result{} @i{implementation-dependent}
  1070. (array-element-type (make-array 12 :element-type '(unsigned-byte 5)))
  1071. @result{} @i{implementation-dependent}
  1072. @end example
  1073. @example
  1074. (array-element-type (make-array 5 :element-type '(mod 5)))
  1075. @end example
  1076. could be @t{(mod 5)}, @t{(mod 8)}, @t{fixnum}, @t{t}, or any other
  1077. type of which @t{(mod 5)} is a @i{subtype}.
  1078. @subsubheading Affected By::
  1079. The @i{implementation}.
  1080. @subsubheading Exceptional Situations::
  1081. Should signal an error of @i{type} @b{type-error} if its argument is not an @i{array}.
  1082. @subsubheading See Also::
  1083. @b{array},
  1084. @ref{make-array}
  1085. ,
  1086. @ref{subtypep}
  1087. ,
  1088. @ref{upgraded-array-element-type}
  1089. @node array-has-fill-pointer-p, array-displacement, array-element-type, Arrays Dictionary
  1090. @subsection array-has-fill-pointer-p [Function]
  1091. @code{array-has-fill-pointer-p} @i{array} @result{} @i{generalized-boolean}
  1092. @subsubheading Arguments and Values::
  1093. @i{array}---an @i{array}.
  1094. @i{generalized-boolean}---a @i{generalized boolean}.
  1095. @subsubheading Description::
  1096. Returns @i{true} if @i{array} has a @i{fill pointer};
  1097. otherwise returns @i{false}.
  1098. @subsubheading Examples::
  1099. @example
  1100. (array-has-fill-pointer-p (make-array 4)) @result{} @i{implementation-dependent}
  1101. (array-has-fill-pointer-p (make-array '(2 3))) @result{} @i{false}
  1102. (array-has-fill-pointer-p
  1103. (make-array 8
  1104. :fill-pointer 2
  1105. :initial-element 'filler)) @result{} @i{true}
  1106. @end example
  1107. @subsubheading Exceptional Situations::
  1108. Should signal an error of @i{type} @b{type-error} if its argument is not an @i{array}.
  1109. @subsubheading See Also::
  1110. @ref{make-array}
  1111. ,
  1112. @ref{fill-pointer}
  1113. @subsubheading Notes::
  1114. Since @i{arrays} of @i{rank} other than one cannot have a @i{fill pointer},
  1115. @b{array-has-fill-pointer-p} always returns @b{nil} when its argument
  1116. is such an array.
  1117. @node array-displacement, array-in-bounds-p, array-has-fill-pointer-p, Arrays Dictionary
  1118. @subsection array-displacement [Function]
  1119. @code{array-displacement} @i{array} @result{} @i{displaced-to, displaced-index-offset}
  1120. @subsubheading Arguments and Values::
  1121. @i{array}---an @i{array}.
  1122. @i{displaced-to}---an @i{array} or @b{nil}.
  1123. @i{displaced-index-offset}---a non-negative @i{fixnum}.
  1124. @subsubheading Description::
  1125. If the @i{array} is a @i{displaced array},
  1126. returns the @i{values} of the @t{:displaced-to} and @t{:displaced-index-offset}
  1127. options
  1128. for the @i{array} (see the @i{functions} @b{make-array} and @b{adjust-array}).
  1129. If the @i{array} is not a @i{displaced array},
  1130. @b{nil} and @t{0} are returned.
  1131. If @b{array-displacement} is called on an @i{array}
  1132. for which a @i{non-nil} @i{object} was provided as the
  1133. @t{:displaced-to} @i{argument} to @b{make-array}
  1134. or @b{adjust-array}, it must return that @i{object}
  1135. as its first value. It is @i{implementation-dependent}
  1136. whether @b{array-displacement} returns a @i{non-nil}
  1137. @i{primary value} for any other @i{array}.
  1138. @subsubheading Examples::
  1139. @example
  1140. (setq a1 (make-array 5)) @result{} #<ARRAY 5 simple 46115576>
  1141. (setq a2 (make-array 4 :displaced-to a1
  1142. :displaced-index-offset 1))
  1143. @result{} #<ARRAY 4 indirect 46117134>
  1144. (array-displacement a2)
  1145. @result{} #<ARRAY 5 simple 46115576>, 1
  1146. (setq a3 (make-array 2 :displaced-to a2
  1147. :displaced-index-offset 2))
  1148. @result{} #<ARRAY 2 indirect 46122527>
  1149. (array-displacement a3)
  1150. @result{} #<ARRAY 4 indirect 46117134>, 2
  1151. @end example
  1152. @subsubheading Exceptional Situations::
  1153. Should signal an error of @i{type} @b{type-error}
  1154. if @i{array} is not an @i{array}.
  1155. @subsubheading See Also::
  1156. @ref{make-array}
  1157. @node array-in-bounds-p, array-rank, array-displacement, Arrays Dictionary
  1158. @subsection array-in-bounds-p [Function]
  1159. @code{array-in-bounds-p} @i{array {&rest} subscripts} @result{} @i{generalized-boolean}
  1160. @subsubheading Arguments and Values::
  1161. @i{array}---an @i{array}.
  1162. @i{subscripts}---a list of @i{integers}
  1163. of length equal to the @i{rank} of the @i{array}.
  1164. @i{generalized-boolean}---a @i{generalized boolean}.
  1165. @subsubheading Description::
  1166. Returns @i{true} if the @i{subscripts} are all in bounds for @i{array};
  1167. otherwise returns @i{false}.
  1168. (If @i{array} is a @i{vector} with a @i{fill pointer},
  1169. that @i{fill pointer} is ignored.)
  1170. @subsubheading Examples::
  1171. @example
  1172. (setq a (make-array '(7 11) :element-type 'string-char))
  1173. (array-in-bounds-p a 0 0) @result{} @i{true}
  1174. (array-in-bounds-p a 6 10) @result{} @i{true}
  1175. (array-in-bounds-p a 0 -1) @result{} @i{false}
  1176. (array-in-bounds-p a 0 11) @result{} @i{false}
  1177. (array-in-bounds-p a 7 0) @result{} @i{false}
  1178. @end example
  1179. @subsubheading See Also::
  1180. @ref{array-dimensions}
  1181. @subsubheading Notes::
  1182. @example
  1183. (array-in-bounds-p array subscripts)
  1184. @equiv{} (and (not (some #'minusp (list subscripts)))
  1185. (every #'< (list subscripts) (array-dimensions array)))
  1186. @end example
  1187. @node array-rank, array-row-major-index, array-in-bounds-p, Arrays Dictionary
  1188. @subsection array-rank [Function]
  1189. @code{array-rank} @i{array} @result{} @i{rank}
  1190. @subsubheading Arguments and Values::
  1191. @i{array}---an @i{array}.
  1192. @i{rank}---a non-negative @i{integer}.
  1193. @subsubheading Description::
  1194. Returns the number of @i{dimensions} of @i{array}.
  1195. @subsubheading Examples::
  1196. @example
  1197. (array-rank (make-array '())) @result{} 0
  1198. (array-rank (make-array 4)) @result{} 1
  1199. (array-rank (make-array '(4))) @result{} 1
  1200. (array-rank (make-array '(2 3))) @result{} 2
  1201. @end example
  1202. @subsubheading Exceptional Situations::
  1203. Should signal an error of @i{type} @b{type-error} if its argument is not an @i{array}.
  1204. @subsubheading See Also::
  1205. @ref{array-rank-limit}
  1206. ,
  1207. @ref{make-array}
  1208. @node array-row-major-index, array-total-size, array-rank, Arrays Dictionary
  1209. @subsection array-row-major-index [Function]
  1210. @code{array-row-major-index} @i{array {&rest} subscripts} @result{} @i{index}
  1211. @subsubheading Arguments and Values::
  1212. @i{array}---an @i{array}.
  1213. @i{subscripts}---a @i{list} of @i{valid array indices} for the @i{array}.
  1214. @i{index}---a @i{valid array row-major index} for the @i{array}.
  1215. @subsubheading Description::
  1216. Computes the position according to the row-major ordering of @i{array}
  1217. for the element that is specified by @i{subscripts}, and returns the
  1218. offset of the element in the computed position from the beginning of @i{array}.
  1219. For a one-dimensional @i{array},
  1220. the result of @b{array-row-major-index}
  1221. equals @i{subscript}.
  1222. @b{array-row-major-index} ignores @i{fill pointers}.
  1223. @subsubheading Examples::
  1224. @example
  1225. (setq a (make-array '(4 7) :element-type '(unsigned-byte 8)))
  1226. (array-row-major-index a 1 2) @result{} 9
  1227. (array-row-major-index
  1228. (make-array '(2 3 4)
  1229. :element-type '(unsigned-byte 8)
  1230. :displaced-to a
  1231. :displaced-index-offset 4)
  1232. 0 2 1) @result{} 9
  1233. @end example
  1234. @subsubheading Notes::
  1235. A possible definition of @b{array-row-major-index},
  1236. with no error-checking, is
  1237. @example
  1238. (defun array-row-major-index (a &rest subscripts)
  1239. (apply #'+ (maplist #'(lambda (x y)
  1240. (* (car x) (apply #'* (cdr y))))
  1241. subscripts
  1242. (array-dimensions a))))
  1243. @end example
  1244. @node array-total-size, arrayp, array-row-major-index, Arrays Dictionary
  1245. @subsection array-total-size [Function]
  1246. @code{array-total-size} @i{array} @result{} @i{size}
  1247. @subsubheading Arguments and Values::
  1248. @i{array}---an @i{array}.
  1249. @i{size}---a non-negative @i{integer}.
  1250. @subsubheading Description::
  1251. Returns the @i{array total size} of the @i{array}.
  1252. @subsubheading Examples::
  1253. @example
  1254. (array-total-size (make-array 4)) @result{} 4
  1255. (array-total-size (make-array 4 :fill-pointer 2)) @result{} 4
  1256. (array-total-size (make-array 0)) @result{} 0
  1257. (array-total-size (make-array '(4 2))) @result{} 8
  1258. (array-total-size (make-array '(4 0))) @result{} 0
  1259. (array-total-size (make-array '())) @result{} 1
  1260. @end example
  1261. @subsubheading Exceptional Situations::
  1262. Should signal an error of @i{type} @b{type-error} if its argument is not an @i{array}.
  1263. @subsubheading See Also::
  1264. @ref{make-array}
  1265. ,
  1266. @ref{array-dimensions}
  1267. @subsubheading Notes::
  1268. If the @i{array} is a @i{vector} with a @i{fill pointer},
  1269. the @i{fill pointer} is ignored when calculating the @i{array total size}.
  1270. Since the product of no arguments is one, the @i{array total size} of a
  1271. zero-dimensional @i{array} is one.
  1272. @example
  1273. (array-total-size x)
  1274. @equiv{} (apply #'* (array-dimensions x))
  1275. @equiv{} (reduce #'* (array-dimensions x))
  1276. @end example
  1277. @node arrayp, fill-pointer, array-total-size, Arrays Dictionary
  1278. @subsection arrayp [Function]
  1279. @code{arrayp} @i{object} @result{} @i{generalized-boolean}
  1280. @subsubheading Arguments and Values::
  1281. @i{object}---an @i{object}.
  1282. @i{generalized-boolean}---a @i{generalized boolean}.
  1283. @subsubheading Description::
  1284. Returns @i{true} if @i{object} is of @i{type} @b{array};
  1285. otherwise, returns @i{false}.
  1286. @subsubheading Examples::
  1287. @example
  1288. (arrayp (make-array '(2 3 4) :adjustable t)) @result{} @i{true}
  1289. (arrayp (make-array 6)) @result{} @i{true}
  1290. (arrayp #*1011) @result{} @i{true}
  1291. (arrayp "hi") @result{} @i{true}
  1292. (arrayp 'hi) @result{} @i{false}
  1293. (arrayp 12) @result{} @i{false}
  1294. @end example
  1295. @subsubheading See Also::
  1296. @ref{typep}
  1297. @subsubheading Notes::
  1298. @example
  1299. (arrayp @i{object}) @equiv{} (typep @i{object} 'array)
  1300. @end example
  1301. @node fill-pointer, row-major-aref, arrayp, Arrays Dictionary
  1302. @subsection fill-pointer [Accessor]
  1303. @code{fill-pointer} @i{vector} @result{} @i{fill-pointer}
  1304. (setf (@code{ fill-pointer} @i{vector}) new-fill-pointer)@*
  1305. @subsubheading Arguments and Values::
  1306. @i{vector}---a @i{vector} with a @i{fill pointer}.
  1307. @i{fill-pointer}, @i{new-fill-pointer}---a @i{valid fill pointer}
  1308. for the @i{vector}.
  1309. @subsubheading Description::
  1310. @i{Accesses} the @i{fill pointer} of @i{vector}.
  1311. @subsubheading Examples::
  1312. @example
  1313. (setq a (make-array 8 :fill-pointer 4)) @result{} #(NIL NIL NIL NIL)
  1314. (fill-pointer a) @result{} 4
  1315. (dotimes (i (length a)) (setf (aref a i) (* i i))) @result{} NIL
  1316. a @result{} #(0 1 4 9)
  1317. (setf (fill-pointer a) 3) @result{} 3
  1318. (fill-pointer a) @result{} 3
  1319. a @result{} #(0 1 4)
  1320. (setf (fill-pointer a) 8) @result{} 8
  1321. a @result{} #(0 1 4 9 NIL NIL NIL NIL)
  1322. @end example
  1323. @subsubheading Exceptional Situations::
  1324. Should signal an error of @i{type} @b{type-error}
  1325. if @i{vector} is not a @i{vector} with a @i{fill pointer}.
  1326. @subsubheading See Also::
  1327. @ref{make-array}
  1328. ,
  1329. @ref{length}
  1330. @subsubheading Notes::
  1331. There is no @i{operator} that will remove a @i{vector}'s @i{fill pointer}.
  1332. @node row-major-aref, upgraded-array-element-type, fill-pointer, Arrays Dictionary
  1333. @subsection row-major-aref [Accessor]
  1334. @code{row-major-aref} @i{array index} @result{} @i{element}
  1335. (setf (@code{ row-major-aref} @i{array index}) new-element)@*
  1336. @subsubheading Arguments and Values::
  1337. @i{array}---an @i{array}.
  1338. @i{index}---a @i{valid array row-major index} for the @i{array}.
  1339. @i{element}, @i{new-element}---an @i{object}.
  1340. @subsubheading Description::
  1341. Considers @i{array} as a @i{vector} by viewing its @i{elements}
  1342. in row-major order, and returns the @i{element} of that @i{vector}
  1343. which is referred to by the given @i{index}.
  1344. @b{row-major-aref} is valid for use with @b{setf}.
  1345. @subsubheading See Also::
  1346. @ref{aref}
  1347. ,
  1348. @ref{array-row-major-index}
  1349. @subsubheading Notes::
  1350. @example
  1351. (row-major-aref array index) @equiv{}
  1352. (aref (make-array (array-total-size array)
  1353. :displaced-to array
  1354. :element-type (array-element-type array))
  1355. index)
  1356. (aref array i1 i2 ...) @equiv{}
  1357. (row-major-aref array (array-row-major-index array i1 i2))
  1358. @end example
  1359. @node upgraded-array-element-type, array-dimension-limit, row-major-aref, Arrays Dictionary
  1360. @subsection upgraded-array-element-type [Function]
  1361. @code{upgraded-array-element-type} @i{typespec {&optional} environment} @result{} @i{upgraded-typespec}
  1362. @subsubheading Arguments and Values::
  1363. @i{typespec}---a @i{type specifier}.
  1364. @i{environment}---an @i{environment} @i{object}.
  1365. The default is @b{nil}, denoting the @i{null lexical environment}
  1366. and the current @i{global environment}.
  1367. @i{upgraded-typespec}---a @i{type specifier}.
  1368. @subsubheading Description::
  1369. Returns the @i{element type} of
  1370. the most @i{specialized} @i{array} representation capable of
  1371. holding items of the @i{type} denoted by @i{typespec}.
  1372. The @i{typespec} is a @i{subtype} of
  1373. (and possibly @i{type equivalent} to)
  1374. the @i{upgraded-typespec}.
  1375. If @i{typespec} is @b{bit},
  1376. the result is @i{type equivalent} to @t{bit}.
  1377. If @i{typespec} is @b{base-char},
  1378. the result is @i{type equivalent} to @t{base-char}.
  1379. If @i{typespec} is @b{character},
  1380. the result is @i{type equivalent} to @t{character}.
  1381. The purpose of @b{upgraded-array-element-type} is to reveal how
  1382. an implementation does its @i{upgrading}.
  1383. The @i{environment} is used to expand any @i{derived type specifiers}
  1384. that are mentioned in the @i{typespec}.
  1385. @subsubheading See Also::
  1386. @ref{array-element-type}
  1387. ,
  1388. @ref{make-array}
  1389. @subsubheading Notes::
  1390. Except for storage allocation consequences and dealing correctly with the
  1391. optional @i{environment} @i{argument},
  1392. @b{upgraded-array-element-type} could be defined as:
  1393. @example
  1394. (defun upgraded-array-element-type (type &optional environment)
  1395. (array-element-type (make-array 0 :element-type type)))
  1396. @end example
  1397. @node array-dimension-limit, array-rank-limit, upgraded-array-element-type, Arrays Dictionary
  1398. @subsection array-dimension-limit [Constant Variable]
  1399. @subsubheading Constant Value::
  1400. A positive
  1401. @i{fixnum},
  1402. the exact magnitude of which is @i{implementation-dependent},
  1403. but which is not less than @t{1024}.
  1404. @subsubheading Description::
  1405. The upper exclusive bound on each individual @i{dimension} of an @i{array}.
  1406. @subsubheading See Also::
  1407. @ref{make-array}
  1408. @node array-rank-limit, array-total-size-limit, array-dimension-limit, Arrays Dictionary
  1409. @subsection array-rank-limit [Constant Variable]
  1410. @subsubheading Constant Value::
  1411. A positive
  1412. @i{fixnum},
  1413. the exact magnitude of which is @i{implementation-dependent},
  1414. but which is not less than @t{8}.
  1415. @subsubheading Description::
  1416. The upper exclusive bound on the @i{rank} of an @i{array}.
  1417. @subsubheading See Also::
  1418. @ref{make-array}
  1419. @node array-total-size-limit, simple-vector-p, array-rank-limit, Arrays Dictionary
  1420. @subsection array-total-size-limit [Constant Variable]
  1421. @subsubheading Constant Value::
  1422. A positive
  1423. @i{fixnum},
  1424. the exact magnitude of which is @i{implementation-dependent},
  1425. but which is not less than @t{1024}.
  1426. @subsubheading Description::
  1427. The upper exclusive bound on the @i{array total size} of an @i{array}.
  1428. The actual limit on the @i{array total size}
  1429. imposed by the @i{implementation}
  1430. might vary according the @i{element type} of the @i{array};
  1431. in this case, the value of @b{array-total-size-limit}
  1432. will be the smallest of these possible limits.
  1433. @subsubheading See Also::
  1434. @ref{make-array}
  1435. ,
  1436. @ref{array-element-type}
  1437. @node simple-vector-p, svref, array-total-size-limit, Arrays Dictionary
  1438. @subsection simple-vector-p [Function]
  1439. @code{simple-vector-p} @i{object} @result{} @i{generalized-boolean}
  1440. @subsubheading Arguments and Values::
  1441. @i{object}---an @i{object}.
  1442. @i{generalized-boolean}---a @i{generalized boolean}.
  1443. @subsubheading Description::
  1444. Returns @i{true} if @i{object} is of @i{type} @b{simple-vector};
  1445. otherwise, returns @i{false}..
  1446. @subsubheading Examples::
  1447. @example
  1448. (simple-vector-p (make-array 6)) @result{} @i{true}
  1449. (simple-vector-p "aaaaaa") @result{} @i{false}
  1450. (simple-vector-p (make-array 6 :fill-pointer t)) @result{} @i{false}
  1451. @end example
  1452. @subsubheading See Also::
  1453. @b{simple-vector}
  1454. @subsubheading Notes::
  1455. @example
  1456. (simple-vector-p @i{object}) @equiv{} (typep @i{object} 'simple-vector)
  1457. @end example
  1458. @node svref, vector, simple-vector-p, Arrays Dictionary
  1459. @subsection svref [Accessor]
  1460. @code{svref} @i{simple-vector index} @result{} @i{element}
  1461. (setf (@code{ svref} @i{simple-vector index}) new-element)@*
  1462. @subsubheading Arguments and Values::
  1463. @i{simple-vector}---a @i{simple vector}.
  1464. @i{index}---a @i{valid array index} for the @i{simple-vector}.
  1465. @i{element}, @i{new-element}---an @i{object}
  1466. (whose @i{type} is a @i{subtype}
  1467. of the @i{array element type} of the @i{simple-vector}).
  1468. @subsubheading Description::
  1469. @i{Accesses} the @i{element} of @i{simple-vector} specified by @i{index}.
  1470. @subsubheading Examples::
  1471. @example
  1472. (simple-vector-p (setq v (vector 1 2 'sirens))) @result{} @i{true}
  1473. (svref v 0) @result{} 1
  1474. (svref v 2) @result{} SIRENS
  1475. (setf (svref v 1) 'newcomer) @result{} NEWCOMER
  1476. v @result{} #(1 NEWCOMER SIRENS)
  1477. @end example
  1478. @subsubheading See Also::
  1479. @ref{aref}
  1480. ,
  1481. @b{sbit},
  1482. @b{schar},
  1483. @ref{vector}
  1484. ,
  1485. @ref{Compiler Terminology}
  1486. @subsubheading Notes::
  1487. @b{svref} is identical to @b{aref}
  1488. except that it requires its first argument to be a @i{simple vector}.
  1489. @example
  1490. (svref @i{v} @i{i}) @equiv{} (aref (the simple-vector @i{v}) @i{i})
  1491. @end example
  1492. @node vector, vector-pop, svref, Arrays Dictionary
  1493. @subsection vector [Function]
  1494. @code{vector} @i{{&rest} objects} @result{} @i{vector}
  1495. @subsubheading Arguments and Values::
  1496. @i{object}---an @i{object}.
  1497. @i{vector}---a @i{vector} of @i{type} @t{(vector t @t{*})}.
  1498. @subsubheading Description::
  1499. Creates a @i{fresh} @i{simple general vector} whose size
  1500. corresponds to the number of @i{objects}.
  1501. The @i{vector} is initialized to contain the @i{objects}.
  1502. @subsubheading Examples::
  1503. @example
  1504. (arrayp (setq v (vector 1 2 'sirens))) @result{} @i{true}
  1505. (vectorp v) @result{} @i{true}
  1506. (simple-vector-p v) @result{} @i{true}
  1507. (length v) @result{} 3
  1508. @end example
  1509. @subsubheading See Also::
  1510. @ref{make-array}
  1511. @subsubheading Notes::
  1512. @b{vector} is analogous to @b{list}.
  1513. @example
  1514. (vector a{{}_1} a{{}_2} ... a{{}_n})
  1515. @equiv{} (make-array (list @i{n}) :element-type t
  1516. :initial-contents
  1517. (list a{{}_1} a{{}_2} ... a{{}_n}))
  1518. @end example
  1519. @node vector-pop, vector-push, vector, Arrays Dictionary
  1520. @subsection vector-pop [Function]
  1521. @code{vector-pop} @i{vector} @result{} @i{element}
  1522. @subsubheading Arguments and Values::
  1523. @i{vector}---a @i{vector} with a @i{fill pointer}.
  1524. @i{element}---an @i{object}.
  1525. @subsubheading Description::
  1526. Decreases the @i{fill pointer} of @i{vector} by one,
  1527. and retrieves the @i{element} of @i{vector} that is
  1528. designated by the new @i{fill pointer}.
  1529. @subsubheading Examples::
  1530. @example
  1531. (vector-push (setq fable (list 'fable))
  1532. (setq fa (make-array 8
  1533. :fill-pointer 2
  1534. :initial-element 'sisyphus))) @result{} 2
  1535. (fill-pointer fa) @result{} 3
  1536. (eq (vector-pop fa) fable) @result{} @i{true}
  1537. (vector-pop fa) @result{} SISYPHUS
  1538. (fill-pointer fa) @result{} 1
  1539. @end example
  1540. @subsubheading Side Effects::
  1541. The @i{fill pointer} is decreased by one.
  1542. @subsubheading Affected By::
  1543. The value of the @i{fill pointer}.
  1544. @subsubheading Exceptional Situations::
  1545. An error of @i{type} @b{type-error} is signaled if @i{vector} does not have a @i{fill pointer}.
  1546. If the @i{fill pointer} is zero, @b{vector-pop} signals an error of @i{type} @b{error}.
  1547. @subsubheading See Also::
  1548. @ref{vector-push; vector-push-extend}
  1549. , @b{vector-push-extend},
  1550. @ref{fill-pointer}
  1551. @node vector-push, vectorp, vector-pop, Arrays Dictionary
  1552. @subsection vector-push, vector-push-extend [Function]
  1553. @code{vector-push} @i{new-element vector} @result{} @i{new-index-p}
  1554. @code{vector-push-extend} @i{new-element vector {&optional} extension} @result{} @i{new-index}
  1555. @subsubheading Arguments and Values::
  1556. @i{new-element}---an @i{object}.
  1557. @i{vector}---a @i{vector} with a @i{fill pointer}.
  1558. @i{extension}---a positive @i{integer}.
  1559. The default is @i{implementation-dependent}.
  1560. @i{new-index-p}---a @i{valid array index} for @i{vector}, or @b{nil}.
  1561. @i{new-index}---a @i{valid array index} for @i{vector}.
  1562. @subsubheading Description::
  1563. @b{vector-push} and @b{vector-push-extend} store
  1564. @i{new-element} in @i{vector}.
  1565. @b{vector-push} attempts to store
  1566. @i{new-element}
  1567. in the element of @i{vector} designated by the @i{fill pointer},
  1568. and to increase the @i{fill pointer} by one. If the
  1569. @t{(>= (fill-pointer @i{vector}) (array-dimension @i{vector} 0))},
  1570. neither @i{vector} nor its @i{fill pointer} are affected.
  1571. Otherwise, the store and increment take
  1572. place and @b{vector-push}
  1573. returns the former value of the @i{fill pointer}
  1574. which is one less than the one it leaves in @i{vector}.
  1575. @b{vector-push-extend} is just like @b{vector-push} except
  1576. that if the @i{fill pointer} gets too large, @i{vector} is extended using
  1577. @b{adjust-array} so that it can contain more elements.
  1578. @i{Extension}
  1579. is the minimum number of elements to be added to @i{vector} if it
  1580. must be extended.
  1581. @b{vector-push} and
  1582. @b{vector-push-extend} return the index of @i{new-element} in @i{vector}.
  1583. If @t{(>= (fill-pointer @i{vector}) (array-dimension @i{vector} 0))},
  1584. @b{vector-push} returns @b{nil}.
  1585. @subsubheading Examples::
  1586. @example
  1587. (vector-push (setq fable (list 'fable))
  1588. (setq fa (make-array 8
  1589. :fill-pointer 2
  1590. :initial-element 'first-one))) @result{} 2
  1591. (fill-pointer fa) @result{} 3
  1592. (eq (aref fa 2) fable) @result{} @i{true}
  1593. (vector-push-extend #\X
  1594. (setq aa
  1595. (make-array 5
  1596. :element-type 'character
  1597. :adjustable t
  1598. :fill-pointer 3))) @result{} 3
  1599. (fill-pointer aa) @result{} 4
  1600. (vector-push-extend #\Y aa 4) @result{} 4
  1601. (array-total-size aa) @result{} at least 5
  1602. (vector-push-extend #\Z aa 4) @result{} 5
  1603. (array-total-size aa) @result{} 9 ;(or more)
  1604. @end example
  1605. @subsubheading Affected By::
  1606. The value of the @i{fill pointer}.
  1607. How @i{vector} was created.
  1608. @subsubheading Exceptional Situations::
  1609. An error of @i{type} @b{error} is signaled by @b{vector-push-extend}
  1610. if it tries to extend @i{vector} and @i{vector} is not @i{actually adjustable}.
  1611. An error of @i{type} @b{error} is signaled if @i{vector} does not
  1612. have a @i{fill pointer}.
  1613. @subsubheading See Also::
  1614. @ref{adjustable-array-p}
  1615. ,
  1616. @ref{fill-pointer}
  1617. ,
  1618. @ref{vector-pop}
  1619. @node vectorp, bit, vector-push, Arrays Dictionary
  1620. @subsection vectorp [Function]
  1621. @code{vectorp} @i{object} @result{} @i{generalized-boolean}
  1622. @subsubheading Arguments and Values::
  1623. @i{object}---an @i{object}.
  1624. @i{generalized-boolean}---a @i{generalized boolean}.
  1625. @subsubheading Description::
  1626. Returns @i{true} if @i{object} is of @i{type} @b{vector};
  1627. otherwise, returns @i{false}.
  1628. @subsubheading Examples::
  1629. @example
  1630. (vectorp "aaaaaa") @result{} @i{true}
  1631. (vectorp (make-array 6 :fill-pointer t)) @result{} @i{true}
  1632. (vectorp (make-array '(2 3 4))) @result{} @i{false}
  1633. (vectorp #*11) @result{} @i{true}
  1634. (vectorp #b11) @result{} @i{false}
  1635. @end example
  1636. @subsubheading Notes::
  1637. @example
  1638. (vectorp @i{object}) @equiv{} (typep @i{object} 'vector)
  1639. @end example
  1640. @node bit, bit-and, vectorp, Arrays Dictionary
  1641. @subsection bit, sbit [Accessor]
  1642. @code{bit} @i{bit-array {&rest} subscripts} @result{} @i{bit}
  1643. @code{sbit} @i{bit-array {&rest} subscripts} @result{} @i{bit}
  1644. (setf (@code{bit} @i{bit-array {&rest} subscripts}) new-bit)@*(setf (@code{sbit} @i{bit-array {&rest} subscripts}) new-bit)@*
  1645. @subsubheading Arguments and Values::
  1646. @i{bit-array}---for @b{bit}, a @i{bit array};
  1647. for @b{sbit}, a @i{simple bit array}.
  1648. @i{subscripts}---a @i{list} of @i{valid array indices}
  1649. for the @i{bit-array}.
  1650. @i{bit}---a @i{bit}.
  1651. @subsubheading Description::
  1652. @b{bit} and @b{sbit} @i{access} the @i{bit-array}
  1653. @i{element} specified by @i{subscripts}.
  1654. These @i{functions} ignore the @i{fill pointer} when @i{accessing} @i{elements}.
  1655. @subsubheading Examples::
  1656. @example
  1657. (bit (setq ba (make-array 8
  1658. :element-type 'bit
  1659. :initial-element 1))
  1660. 3) @result{} 1
  1661. (setf (bit ba 3) 0) @result{} 0
  1662. (bit ba 3) @result{} 0
  1663. (sbit ba 5) @result{} 1
  1664. (setf (sbit ba 5) 1) @result{} 1
  1665. (sbit ba 5) @result{} 1
  1666. @end example
  1667. @subsubheading See Also::
  1668. @ref{aref}
  1669. ,
  1670. @ref{Compiler Terminology}
  1671. @subsubheading Notes::
  1672. @b{bit} and @b{sbit} are like @b{aref}
  1673. except that they require @i{arrays} to be
  1674. a @i{bit array} and a @i{simple bit array}, respectively.
  1675. @b{bit} and @b{sbit}, unlike @b{char} and @b{schar},
  1676. allow the first argument to be an @i{array} of any @i{rank}.
  1677. @node bit-and, bit-vector-p, bit, Arrays Dictionary
  1678. @subsection bit-and, bit-andc1, bit-andc2, bit-eqv,
  1679. @subheading bit-ior, bit-nand, bit-nor, bit-not, bit-orc1, bit-orc2, bit-xor
  1680. @flushright
  1681. @i{[Function]}
  1682. @end flushright
  1683. @code{bit-and} @i{bit-array1 bit-array2 {&optional} opt-arg} @result{} @i{resulting-bit-array}
  1684. @code{bit-andc1} @i{bit-array1 bit-array2 {&optional} opt-arg} @result{} @i{resulting-bit-array}
  1685. @code{bit-andc2} @i{bit-array1 bit-array2 {&optional} opt-arg} @result{} @i{resulting-bit-array}
  1686. @code{bit-eqv} @i{bit-array1 bit-array2 {&optional} opt-arg} @result{} @i{resulting-bit-array}
  1687. @code{bit-ior} @i{bit-array1 bit-array2 {&optional} opt-arg} @result{} @i{resulting-bit-array}
  1688. @code{bit-nand} @i{bit-array1 bit-array2 {&optional} opt-arg} @result{} @i{resulting-bit-array}
  1689. @code{bit-nor} @i{bit-array1 bit-array2 {&optional} opt-arg} @result{} @i{resulting-bit-array}
  1690. @code{bit-orc1} @i{bit-array1 bit-array2 {&optional} opt-arg} @result{} @i{resulting-bit-array}
  1691. @code{bit-orc2} @i{bit-array1 bit-array2 {&optional} opt-arg} @result{} @i{resulting-bit-array}
  1692. @code{bit-xor} @i{bit-array1 bit-array2 {&optional} opt-arg} @result{} @i{resulting-bit-array}
  1693. @code{bit-not} @i{bit-array {&optional} opt-arg} @result{} @i{resulting-bit-array}
  1694. @subsubheading Arguments and Values::
  1695. @i{bit-array}, @i{bit-array1}, @i{bit-array2}---a @i{bit array}.
  1696. @i{Opt-arg}---a @i{bit array}, or @b{t}, or @b{nil}.
  1697. The default is @b{nil}.
  1698. @i{Bit-array}, @i{bit-array1}, @i{bit-array2}, and @i{opt-arg}
  1699. (if an @i{array}) must all be of the same @i{rank} and @i{dimensions}.
  1700. @i{resulting-bit-array}---a @i{bit array}.
  1701. @subsubheading Description::
  1702. These functions perform
  1703. bit-wise logical operations on @i{bit-array1} and @i{bit-array2}
  1704. and return an @i{array}
  1705. of matching @i{rank} and @i{dimensions},
  1706. such that any given bit of the result
  1707. is produced by operating on corresponding bits from each of the arguments.
  1708. In the case of @b{bit-not}, an @i{array}
  1709. of @i{rank} and @i{dimensions} matching @i{bit-array}
  1710. is returned that contains a copy of @i{bit-array}
  1711. with all the bits inverted.
  1712. If @i{opt-arg} is of type @t{(array bit)} the contents of the
  1713. result are destructively placed into @i{opt-arg}.
  1714. If @i{opt-arg} is the symbol @b{t},
  1715. @i{bit-array} or @i{bit-array1} is replaced with the result;
  1716. if @i{opt-arg} is @b{nil} or omitted, a new @i{array} is created
  1717. to contain the result.
  1718. Figure 15--4 indicates the logical operation
  1719. performed by each of the @i{functions}.
  1720. 2
  1721. @group
  1722. @noindent
  1723. @w{@b{Function} @b{Operation} }
  1724. @w{_______________________________________________________________________________________________________}
  1725. @w{ }
  1726. @w{@b{bit-and} and }
  1727. @w{@b{bit-eqv} equivalence (exclusive nor) }
  1728. @w{@b{bit-not} complement }
  1729. @w{@b{bit-ior} inclusive or }
  1730. @w{@b{bit-xor} exclusive or }
  1731. @w{@b{bit-nand} complement of @i{bit-array1} and @i{bit-array2} }
  1732. @w{@b{bit-nor} complement of @i{bit-array1} or @i{bit-array2} }
  1733. @w{@b{bit-andc1} and complement of @i{bit-array1} with @i{bit-array2}}
  1734. @w{@b{bit-andc2} and @i{bit-array1} with complement of @i{bit-array2}}
  1735. @w{@b{bit-orc1} or complement of @i{bit-array1} with @i{bit-array2} }
  1736. @w{@b{bit-orc2} or @i{bit-array1} with complement of @i{bit-array2} }
  1737. @w{@w{ Figure 15--3: Bit-wise Logical Operations on Bit Arrays}
  1738. }
  1739. @end group
  1740. @subsubheading Examples::
  1741. @example
  1742. (bit-and (setq ba #*11101010) #*01101011) @result{} #*01101010
  1743. (bit-and #*1100 #*1010) @result{} #*1000
  1744. (bit-andc1 #*1100 #*1010) @result{} #*0010
  1745. (setq rba (bit-andc2 ba #*00110011 t)) @result{} #*11001000
  1746. (eq rba ba) @result{} @i{true}
  1747. (bit-not (setq ba #*11101010)) @result{} #*00010101
  1748. (setq rba (bit-not ba
  1749. (setq tba (make-array 8
  1750. :element-type 'bit))))
  1751. @result{} #*00010101
  1752. (equal rba tba) @result{} @i{true}
  1753. (bit-xor #*1100 #*1010) @result{} #*0110
  1754. @end example
  1755. @subsubheading See Also::
  1756. @b{lognot},
  1757. @ref{logand; logandc1; logandc2; logeqv; logior; lognand; lognor; lognot; logorc1; logorc2; logxor}
  1758. @node bit-vector-p, simple-bit-vector-p, bit-and, Arrays Dictionary
  1759. @subsection bit-vector-p [Function]
  1760. @code{bit-vector-p} @i{object} @result{} @i{generalized-boolean}
  1761. @subsubheading Arguments and Values::
  1762. @i{object}---an @i{object}.
  1763. @i{generalized-boolean}---a @i{generalized boolean}.
  1764. @subsubheading Description::
  1765. Returns @i{true} if @i{object} is of @i{type} @b{bit-vector};
  1766. otherwise, returns @i{false}.
  1767. @subsubheading Examples::
  1768. @example
  1769. (bit-vector-p (make-array 6
  1770. :element-type 'bit
  1771. :fill-pointer t)) @result{} @i{true}
  1772. (bit-vector-p #*) @result{} @i{true}
  1773. (bit-vector-p (make-array 6)) @result{} @i{false}
  1774. @end example
  1775. @subsubheading See Also::
  1776. @ref{typep}
  1777. @subsubheading Notes::
  1778. @example
  1779. (bit-vector-p @i{object}) @equiv{} (typep @i{object} 'bit-vector)
  1780. @end example
  1781. @node simple-bit-vector-p, , bit-vector-p, Arrays Dictionary
  1782. @subsection simple-bit-vector-p [Function]
  1783. @code{simple-bit-vector-p} @i{object} @result{} @i{generalized-boolean}
  1784. @subsubheading Arguments and Values::
  1785. @i{object}---an @i{object}.
  1786. @i{generalized-boolean}---a @i{generalized boolean}.
  1787. @subsubheading Description::
  1788. Returns @i{true} if @i{object} is of @i{type} @b{simple-bit-vector};
  1789. otherwise, returns @i{false}.
  1790. @subsubheading Examples::
  1791. @example
  1792. (simple-bit-vector-p (make-array 6)) @result{} @i{false}
  1793. (simple-bit-vector-p #*) @result{} @i{true}
  1794. @end example
  1795. @subsubheading See Also::
  1796. @ref{simple-vector-p}
  1797. @subsubheading Notes::
  1798. @example
  1799. (simple-bit-vector-p @i{object}) @equiv{} (typep @i{object} 'simple-bit-vector)
  1800. @end example
  1801. @c end of including dict-arrays
  1802. @c %**end of chapter