My various dotfiles

chap-16.texi 23KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770
  1. @node Strings, Sequences, Arrays, Top
  2. @chapter Strings
  3. @menu
  4. * String Concepts::
  5. * Strings Dictionary::
  6. @end menu
  7. @node String Concepts, Strings Dictionary, Strings, Strings
  8. @section String Concepts
  9. @c including concept-strings
  10. @menu
  11. * Implications of Strings Being Arrays::
  12. * Subtypes of STRING::
  13. @end menu
  14. @node Implications of Strings Being Arrays, Subtypes of STRING, String Concepts, String Concepts
  15. @subsection Implications of Strings Being Arrays
  16. Since all @i{strings} are @i{arrays}, all rules which apply
  17. generally to @i{arrays} also apply to @i{strings}.
  18. See @ref{Array Concepts}.
  19. For example,
  20. @i{strings} can have @i{fill pointers},
  21. and @i{strings} are also subject to the rules of @i{element type} @i{upgrading}
  22. that apply to @i{arrays}.
  23. @node Subtypes of STRING, , Implications of Strings Being Arrays, String Concepts
  24. @subsection Subtypes of STRING
  25. All functions that operate on @i{strings}
  26. will operate on @i{subtypes} of @i{string} as well.
  27. However,
  28. the consequences are undefined if a @i{character} is inserted into a @i{string}
  29. for which the @i{element type} of the @i{string} does not include that @i{character}.
  30. @c end of including concept-strings
  31. @node Strings Dictionary, , String Concepts, Strings
  32. @section Strings Dictionary
  33. @c including dict-strings
  34. @menu
  35. * string (System Class)::
  36. * base-string::
  37. * simple-string::
  38. * simple-base-string::
  39. * simple-string-p::
  40. * char::
  41. * string::
  42. * string-upcase::
  43. * string-trim::
  44. * string=::
  45. * stringp::
  46. * make-string::
  47. @end menu
  48. @node string (System Class), base-string, Strings Dictionary, Strings Dictionary
  49. @subsection string [System Class]
  50. @subsubheading Class Precedence List::
  51. @b{string},
  52. @b{vector},
  53. @b{array},
  54. @b{sequence},
  55. @b{t}
  56. @subsubheading Description::
  57. A @i{string} is a @i{specialized} @i{vector}
  58. whose @i{elements} are of @i{type} @b{character} or a @i{subtype} of @i{type} @b{character}.
  59. When used as a @i{type specifier} for object creation,
  60. @b{string} means @t{(vector character)}.
  61. @subsubheading Compound Type Specifier Kind::
  62. Abbreviating.
  63. @subsubheading Compound Type Specifier Syntax::
  64. (@code{string}@{@i{@t{[}size@t{]}}@})
  65. @subsubheading Compound Type Specifier Arguments::
  66. @i{size}---a non-negative @i{fixnum},
  67. or the @i{symbol} @b{*}.
  68. @subsubheading Compound Type Specifier Description::
  69. This denotes the union of all @i{types}
  70. @t{(array @i{c} (@i{size}))}
  71. for all @i{subtypes} @i{c} of @b{character};
  72. that is, the set of @i{strings} of size @i{size}.
  73. @subsubheading See Also::
  74. @ref{String Concepts},
  75. @ref{Double-Quote},
  76. @ref{Printing Strings}
  77. @node base-string, simple-string, string (System Class), Strings Dictionary
  78. @subsection base-string [Type]
  79. @subsubheading Supertypes::
  80. @b{base-string},
  81. @b{string},
  82. @b{vector},
  83. @b{array},
  84. @b{sequence},
  85. @b{t}
  86. @subsubheading Description::
  87. The @i{type} @b{base-string} is equivalent to
  88. @t{(vector base-char)}.
  89. The @i{base string} representation is the most efficient @i{string} representation
  90. that can hold an arbitrary sequence of @i{standard characters}.
  91. @subsubheading Compound Type Specifier Kind::
  92. Abbreviating.
  93. @subsubheading Compound Type Specifier Syntax::
  94. (@code{base-string}@{@i{@t{[}size@t{]}}@})
  95. @subsubheading Compound Type Specifier Arguments::
  96. @i{size}---a non-negative @i{fixnum},
  97. or the @i{symbol} @b{*}.
  98. @subsubheading Compound Type Specifier Description::
  99. This is equivalent to the type @t{(vector base-char @i{size})};
  100. that is, the set of @i{base strings} of size @i{size}.
  101. @node simple-string, simple-base-string, base-string, Strings Dictionary
  102. @subsection simple-string [Type]
  103. @subsubheading Supertypes::
  104. @b{simple-string},
  105. @b{string},
  106. @b{vector},
  107. @b{simple-array},
  108. @b{array},
  109. @b{sequence},
  110. @b{t}
  111. @subsubheading Description::
  112. A @i{simple string} is a specialized one-dimensional
  113. @i{simple array} whose @i{elements} are of @i{type} @b{character} or a @i{subtype} of @i{type} @b{character}.
  114. When used as a @i{type specifier} for object creation,
  115. @b{simple-string} means @t{(simple-array character (@i{size}))}.
  116. @subsubheading Compound Type Specifier Kind::
  117. Abbreviating.
  118. @subsubheading Compound Type Specifier Syntax::
  119. (@code{simple-string}@{@i{@t{[}size@t{]}}@})
  120. @subsubheading Compound Type Specifier Arguments::
  121. @i{size}---a non-negative @i{fixnum},
  122. or the @i{symbol} @b{*}.
  123. @subsubheading Compound Type Specifier Description::
  124. This denotes the union of all @i{types}
  125. @t{(simple-array @i{c} (@i{size}))} for all @i{subtypes} @i{c} of
  126. @b{character}; that is, the set of @i{simple strings} of size @i{size}.
  127. @node simple-base-string, simple-string-p, simple-string, Strings Dictionary
  128. @subsection simple-base-string [Type]
  129. @subsubheading Supertypes::
  130. @b{simple-base-string},
  131. @b{base-string},
  132. @b{simple-string},
  133. @b{string},
  134. @b{vector},
  135. @b{simple-array},
  136. @b{array},
  137. @b{sequence},
  138. @b{t}
  139. @subsubheading Description::
  140. The @i{type} @b{simple-base-string} is equivalent to
  141. @t{(simple-array base-char (*))}.
  142. @subsubheading Compound Type Specifier Kind::
  143. Abbreviating.
  144. @subsubheading Compound Type Specifier Syntax::
  145. (@code{simple-base-string}@{@i{@t{[}size@t{]}}@})
  146. @subsubheading Compound Type Specifier Arguments::
  147. @i{size}---a non-negative @i{fixnum},
  148. or the @i{symbol} @b{*}.
  149. @subsubheading Compound Type Specifier Description::
  150. This is equivalent to the type @t{(simple-array base-char (@i{size}))};
  151. that is, the set of @i{simple base strings} of size @i{size}.
  152. @node simple-string-p, char, simple-base-string, Strings Dictionary
  153. @subsection simple-string-p [Function]
  154. @code{simple-string-p} @i{object} @result{} @i{generalized-boolean}
  155. @subsubheading Arguments and Values::
  156. @i{object}---an @i{object}.
  157. @i{generalized-boolean}---a @i{generalized boolean}.
  158. @subsubheading Description::
  159. Returns @i{true} if @i{object} is of @i{type} @b{simple-string};
  160. otherwise, returns @i{false}.
  161. @subsubheading Examples::
  162. @example
  163. (simple-string-p "aaaaaa") @result{} @i{true}
  164. (simple-string-p (make-array 6
  165. :element-type 'character
  166. :fill-pointer t)) @result{} @i{false}
  167. @end example
  168. @subsubheading Notes::
  169. @example
  170. (simple-string-p @i{object}) @equiv{} (typep @i{object} 'simple-string)
  171. @end example
  172. @node char, string, simple-string-p, Strings Dictionary
  173. @subsection char, schar [Accessor]
  174. @code{char} @i{string index} @result{} @i{character}
  175. @code{schar} @i{string index} @result{} @i{character}
  176. (setf (@code{char} @i{string index}) new-character)@*(setf (@code{schar} @i{string index}) new-character)@*
  177. @subsubheading Arguments and Values::
  178. @i{string}---for @b{char}, a @i{string};
  179. for @b{schar}, a @i{simple string}.
  180. @i{index}---a @i{valid array index} for the @i{string}.
  181. @i{character}, @i{new-character}---a @i{character}.
  182. @subsubheading Description::
  183. @b{char} and @b{schar} @i{access} the @i{element} of @i{string}
  184. specified by @i{index}.
  185. @b{char} ignores @i{fill pointers} when @i{accessing} @i{elements}.
  186. @subsubheading Examples::
  187. @example
  188. (setq my-simple-string (make-string 6 :initial-element #\A)) @result{} "AAAAAA"
  189. (schar my-simple-string 4) @result{} #\A
  190. (setf (schar my-simple-string 4) #\B) @result{} #\B
  191. my-simple-string @result{} "AAAABA"
  192. (setq my-filled-string
  193. (make-array 6 :element-type 'character
  194. :fill-pointer 5
  195. :initial-contents my-simple-string))
  196. @result{} "AAAAB"
  197. (char my-filled-string 4) @result{} #\B
  198. (char my-filled-string 5) @result{} #\A
  199. (setf (char my-filled-string 3) #\C) @result{} #\C
  200. (setf (char my-filled-string 5) #\D) @result{} #\D
  201. (setf (fill-pointer my-filled-string) 6) @result{} 6
  202. my-filled-string @result{} "AAACBD"
  203. @end example
  204. @subsubheading See Also::
  205. @ref{aref}
  206. ,
  207. @ref{elt}
  208. ,
  209. @ref{Compiler Terminology}
  210. @subsubheading Notes::
  211. @example
  212. (char s j) @equiv{} (aref (the string s) j)
  213. @end example
  214. @node string, string-upcase, char, Strings Dictionary
  215. @subsection string [Function]
  216. @code{string} @i{x} @result{} @i{string}
  217. @subsubheading Arguments and Values::
  218. @i{x}---a @i{string}, a @i{symbol}, or a @i{character}.
  219. @i{string}---a @i{string}.
  220. @subsubheading Description::
  221. Returns a @i{string} described by @i{x}; specifically:
  222. @table @asis
  223. @item @t{*}
  224. If @i{x} is a @i{string}, it is returned.
  225. @item @t{*}
  226. If @i{x} is a @i{symbol}, its @i{name} is returned.
  227. @item @t{*}
  228. If @i{x} is a @i{character},
  229. then a @i{string} containing that one @i{character} is returned.
  230. @item @t{*}
  231. @b{string} might perform additional, @i{implementation-defined} conversions.
  232. @end table
  233. @subsubheading Examples::
  234. @example
  235. (string "already a string") @result{} "already a string"
  236. (string 'elm) @result{} "ELM"
  237. (string #\c) @result{} "c"
  238. @end example
  239. @subsubheading Exceptional Situations::
  240. In the case where a conversion is defined neither by this specification nor
  241. by the @i{implementation}, an error of @i{type} @b{type-error} is signaled.
  242. @subsubheading See Also::
  243. @ref{coerce}
  244. ,
  245. @b{string} (@i{type}).
  246. @subsubheading Notes::
  247. @b{coerce} can be used to convert a @i{sequence} of @i{characters}
  248. to a @i{string}.
  249. @b{prin1-to-string}, @b{princ-to-string}, @b{write-to-string},
  250. or @b{format} (with a first argument of @b{nil}) can be used to get a
  251. @i{string} representation of a @i{number} or any other @i{object}.
  252. @node string-upcase, string-trim, string, Strings Dictionary
  253. @subsection string-upcase, string-downcase, string-capitalize,
  254. @subheading nstring-upcase, nstring-downcase, nstring-capitalize
  255. @flushright
  256. @i{[Function]}
  257. @end flushright
  258. @code{string-upcase} @i{string {&key} start end} @result{} @i{cased-string}
  259. @code{string-downcase} @i{string {&key} start end} @result{} @i{cased-string}
  260. @code{string-capitalize} @i{string {&key} start end} @result{} @i{cased-string}
  261. @code{nstring-upcase} @i{string {&key} start end} @result{} @i{string}
  262. @code{nstring-downcase} @i{string {&key} start end} @result{} @i{string}
  263. @code{nstring-capitalize} @i{string {&key} start end} @result{} @i{string}
  264. @subsubheading Arguments and Values::
  265. @i{string}---a @i{string designator}.
  266. For @b{nstring-upcase},
  267. @b{nstring-downcase},
  268. and @b{nstring-capitalize},
  269. the @i{string} @i{designator} must be a @i{string}.
  270. @i{start}, @i{end}---@i{bounding index designators} of @i{string}.
  271. The defaults for @i{start} and @i{end} are @t{0} and @b{nil}, respectively.
  272. @i{cased-string}---a @i{string}.
  273. @subsubheading Description::
  274. @b{string-upcase}, @b{string-downcase}, @b{string-capitalize},
  275. @b{nstring-upcase}, @b{nstring-downcase}, @b{nstring-capitalize}
  276. change the case of the subsequence of @i{string}
  277. @i{bounded} by @i{start} and @i{end}
  278. as follows:
  279. @table @asis
  280. @item string-upcase
  281. @b{string-upcase} returns a @i{string} just like @i{string}
  282. with all lowercase characters replaced by the corresponding uppercase
  283. characters. More precisely, each character of the result @i{string}
  284. is produced by applying the @i{function} @b{char-upcase} to the corresponding
  285. character of @i{string}.
  286. @item string-downcase
  287. @b{string-downcase} is like @b{string-upcase}
  288. except that all uppercase characters are replaced by the corresponding
  289. lowercase characters (using @b{char-downcase}).
  290. @item string-capitalize
  291. @b{string-capitalize} produces a copy of @i{string} such that,
  292. for every word in the copy, the first @i{character} of the ``word,''
  293. if it has @i{case}, is @i{uppercase} and
  294. any other @i{characters} with @i{case} in the word are @i{lowercase}.
  295. For the purposes of @b{string-capitalize},
  296. a ``word'' is defined to be a
  297. consecutive subsequence consisting of @i{alphanumeric} @i{characters},
  298. delimited at each end either by a non-@i{alphanumeric} @i{character}
  299. or by an end of the @i{string}.
  300. @item nstring-upcase, nstring-downcase, nstring-capitalize
  301. @b{nstring-upcase}, @b{nstring-downcase},
  302. and @b{nstring-capitalize} are identical to @b{string-upcase},
  303. @b{string-downcase}, and @b{string-capitalize}
  304. respectively except that they modify @i{string}.
  305. @end table
  306. For @b{string-upcase}, @b{string-downcase}, and @b{string-capitalize},
  307. @i{string} is not modified. However, if no characters in @i{string}
  308. require conversion, the result may be either @i{string} or a copy of it,
  309. at the implementation's discretion.
  310. @subsubheading Examples::
  311. @example
  312. (string-upcase "abcde") @result{} "ABCDE"
  313. (string-upcase "Dr. Livingston, I presume?")
  314. @result{} "DR. LIVINGSTON, I PRESUME?"
  315. (string-upcase "Dr. Livingston, I presume?" :start 6 :end 10)
  316. @result{} "Dr. LiVINGston, I presume?"
  317. (string-downcase "Dr. Livingston, I presume?")
  318. @result{} "dr. livingston, i presume?"
  319. (string-capitalize "elm 13c arthur;fig don't") @result{} "Elm 13c Arthur;Fig Don'T"
  320. (string-capitalize " hello ") @result{} " Hello "
  321. (string-capitalize "occlUDeD cASEmenTs FOreSTAll iNADVertent DEFenestraTION")
  322. @result{} "Occluded Casements Forestall Inadvertent Defenestration"
  323. (string-capitalize 'kludgy-hash-search) @result{} "Kludgy-Hash-Search"
  324. (string-capitalize "DON'T!") @result{} "Don'T!" ;not "Don't!"
  325. (string-capitalize "pipe 13a, foo16c") @result{} "Pipe 13a, Foo16c"
  326. (setq str (copy-seq "0123ABCD890a")) @result{} "0123ABCD890a"
  327. (nstring-downcase str :start 5 :end 7) @result{} "0123AbcD890a"
  328. str @result{} "0123AbcD890a"
  329. @end example
  330. @subsubheading Side Effects::
  331. @b{nstring-upcase},
  332. @b{nstring-downcase},
  333. and @b{nstring-capitalize} modify @i{string} as appropriate
  334. rather than constructing a new @i{string}.
  335. @subsubheading See Also::
  336. @ref{char-upcase; char-downcase}
  337. , @b{char-downcase}
  338. @subsubheading Notes::
  339. The result is always of the same length
  340. as @i{string}.
  341. @node string-trim, string=, string-upcase, Strings Dictionary
  342. @subsection string-trim, string-left-trim, string-right-trim [Function]
  343. @code{string-trim} @i{character-bag string} @result{} @i{trimmed-string}
  344. @code{string-left-trim} @i{character-bag string} @result{} @i{trimmed-string}
  345. @code{string-right-trim} @i{character-bag string} @result{} @i{trimmed-string}
  346. @subsubheading Arguments and Values::
  347. @i{character-bag}---a @i{sequence} containing @i{characters}.
  348. @i{string}---a @i{string designator}.
  349. @i{trimmed-string}---a @i{string}.
  350. @subsubheading Description::
  351. @b{string-trim} returns a substring of @i{string},
  352. with all characters in @i{character-bag} stripped off the beginning and end.
  353. @b{string-left-trim} is similar but strips characters off only the beginning;
  354. @b{string-right-trim} strips off only the end.
  355. If no @i{characters} need to be trimmed from the @i{string},
  356. then either @i{string} itself or a copy of it may be returned,
  357. at the discretion of the implementation.
  358. All of these @i{functions} observe the @i{fill pointer}.
  359. @subsubheading Examples::
  360. @example
  361. (string-trim "abc" "abcaakaaakabcaaa") @result{} "kaaak"
  362. (string-trim '(#\Space #\Tab #\Newline) " garbanzo beans
  363. ") @result{} "garbanzo beans"
  364. (string-trim " (*)" " ( *three (silly) words* ) ")
  365. @result{} "three (silly) words"
  366. (string-left-trim "abc" "labcabcabc") @result{} "labcabcabc"
  367. (string-left-trim " (*)" " ( *three (silly) words* ) ")
  368. @result{} "three (silly) words* ) "
  369. (string-right-trim " (*)" " ( *three (silly) words* ) ")
  370. @result{} " ( *three (silly) words"
  371. @end example
  372. @subsubheading Affected By::
  373. The @i{implementation}.
  374. @node string=, stringp, string-trim, Strings Dictionary
  375. @subsection string=, string/=, string<, string>, string<=, string>=,
  376. @subheading string-equal, string-not-equal, string-lessp,
  377. @subheading string-greaterp, string-not-greaterp, string-not-lessp
  378. @flushright
  379. @i{[Function]}
  380. @end flushright
  381. @code{string=} @i{string1 string2 {&key} start1 end1 start2 end2} @result{} @i{generalized-boolean}
  382. @code{string/=} @i{string1 string2 {&key} start1 end1 start2 end2} @result{} @i{mismatch-index}
  383. @code{string<} @i{string1 string2 {&key} start1 end1 start2 end2} @result{} @i{mismatch-index}
  384. @code{string>} @i{string1 string2 {&key} start1 end1 start2 end2} @result{} @i{mismatch-index}
  385. @code{string<=} @i{string1 string2 {&key} start1 end1 start2 end2} @result{} @i{mismatch-index}
  386. @code{string>=} @i{string1 string2 {&key} start1 end1 start2 end2} @result{} @i{mismatch-index}
  387. @code{string-equal} @i{string1 string2 {&key} start1 end1 start2 end2} @result{} @i{generalized-boolean}
  388. @code{string-not-equal} @i{string1 string2 {&key} start1 end1 start2 end2} @result{} @i{mismatch-index}
  389. @code{string-lessp} @i{string1 string2 {&key} start1 end1 start2 end2} @result{} @i{mismatch-index}
  390. @code{string-greaterp} @i{string1 string2 {&key} start1 end1 start2 end2} @result{} @i{mismatch-index}
  391. @code{string-not-greaterp} @i{string1 string2 {&key} start1 end1 start2 end2} @result{} @i{mismatch-index}
  392. @code{string-not-lessp} @i{string1 string2 {&key} start1 end1 start2 end2} @result{} @i{mismatch-index}
  393. @subsubheading Arguments and Values::
  394. @i{string1}---a @i{string designator}.
  395. @i{string2}---a @i{string designator}.
  396. @i{start1}, @i{end1}---@i{bounding index designators} of @i{string1}.
  397. The defaults for @i{start} and @i{end} are @t{0} and @b{nil}, respectively.
  398. @i{start2}, @i{end2}---@i{bounding index designators} of @i{string2}.
  399. The defaults for @i{start} and @i{end} are @t{0} and @b{nil}, respectively.
  400. @i{generalized-boolean}---a @i{generalized boolean}.
  401. @i{mismatch-index}---a @i{bounding index} of @i{string1}, or @b{nil}.
  402. @subsubheading Description::
  403. These functions perform lexicographic comparisons on @i{string1} and @i{string2}.
  404. @b{string=} and @b{string-equal} are called equality functions;
  405. the others are called inequality functions.
  406. The comparison operations these @i{functions} perform are restricted
  407. to the subsequence of @i{string1} @i{bounded} by @i{start1} and @i{end1}
  408. and to the subsequence of @i{string2} @i{bounded} by @i{start2} and @i{end2}.
  409. A string @i{a} is equal to a string @i{b} if it contains the same number
  410. of characters, and the corresponding characters are the @i{same}
  411. under @b{char=} or @b{char-equal}, as appropriate.
  412. A string @i{a} is less than a string @i{b} if in the first position in
  413. which they differ the character of @i{a} is less than the corresponding
  414. character of @i{b} according to @b{char<} or @b{char-lessp}
  415. as appropriate, or if string @i{a} is a proper prefix of string @i{b}
  416. (of shorter length and matching in all the characters of @i{a}).
  417. The equality functions return a @i{generalized boolean}
  418. that is @i{true} if the strings are equal,
  419. or @i{false} otherwise.
  420. The inequality functions return a @i{mismatch-index}
  421. that is @i{true} if the strings are not equal,
  422. or @i{false} otherwise.
  423. When the @i{mismatch-index} is @i{true},
  424. it is an @i{integer} representing the first character position at which the
  425. two substrings differ, as an offset from the beginning of @i{string1}.
  426. The comparison has one of the following results:
  427. @table @asis
  428. @item @b{string=}
  429. @b{string=} is @i{true} if the supplied substrings are of
  430. the same length and contain the @i{same} characters in corresponding
  431. positions; otherwise it is @i{false}.
  432. @item @b{string/=}
  433. @b{string/=} is @i{true} if the supplied substrings are
  434. different; otherwise it is @i{false}.
  435. @item @b{string-equal}
  436. @b{string-equal} is just like @b{string=}
  437. except that differences in case are ignored;
  438. two characters are considered to be the same if @b{char-equal} is @i{true} of them.
  439. @item @b{string<}
  440. @b{string<} is @i{true} if substring1 is less than substring2;
  441. otherwise it is @i{false}.
  442. @item @b{string>}
  443. @b{string>} is @i{true} if substring1 is greater than substring2;
  444. otherwise it is @i{false}.
  445. @item @b{string-lessp}, @b{string-greaterp}
  446. @b{string-lessp} and @b{string-greaterp}
  447. are exactly like @b{string<} and @b{string>}, respectively,
  448. except that distinctions between uppercase and lowercase letters are ignored.
  449. It is as if @b{char-lessp} were used instead of @b{char<}
  450. for comparing characters.
  451. @item @b{string<=}
  452. @b{string<=} is @i{true} if substring1 is less than or equal to substring2;
  453. otherwise it is @i{false}.
  454. @item @b{string>=}
  455. @b{string>=} is @i{true} if substring1 is greater than or equal to substring2;
  456. otherwise it is @i{false}.
  457. @item @b{string-not-greaterp}, @b{string-not-lessp}
  458. @b{string-not-greaterp} and @b{string-not-lessp}
  459. are exactly like @b{string<=} and @b{string>=}, respectively,
  460. except that distinctions between uppercase and lowercase letters are ignored.
  461. It is as if @b{char-lessp} were used instead of @b{char<}
  462. for comparing characters.
  463. @end table
  464. @subsubheading Examples::
  465. @example
  466. (string= "foo" "foo") @result{} @i{true}
  467. (string= "foo" "Foo") @result{} @i{false}
  468. (string= "foo" "bar") @result{} @i{false}
  469. (string= "together" "frog" :start1 1 :end1 3 :start2 2) @result{} @i{true}
  470. (string-equal "foo" "Foo") @result{} @i{true}
  471. (string= "abcd" "01234abcd9012" :start2 5 :end2 9) @result{} @i{true}
  472. (string< "aaaa" "aaab") @result{} 3
  473. (string>= "aaaaa" "aaaa") @result{} 4
  474. (string-not-greaterp "Abcde" "abcdE") @result{} 5
  475. (string-lessp "012AAAA789" "01aaab6" :start1 3 :end1 7
  476. :start2 2 :end2 6) @result{} 6
  477. (string-not-equal "AAAA" "aaaA") @result{} @i{false}
  478. @end example
  479. @subsubheading See Also::
  480. @ref{char=; char/=; char<; char>; char<=; char>=; char-equal; char-not-equal; char-lessp; char-greaterp; char-not-greaterp; char-not-lessp}
  481. @subsubheading Notes::
  482. @b{equal} calls @b{string=} if applied to two @i{strings}.
  483. @node stringp, make-string, string=, Strings Dictionary
  484. @subsection stringp [Function]
  485. @code{stringp} @i{object} @result{} @i{generalized-boolean}
  486. @subsubheading Arguments and Values::
  487. @i{object}---an @i{object}.
  488. @i{generalized-boolean}---a @i{generalized boolean}.
  489. @subsubheading Description::
  490. Returns @i{true} if @i{object} is of @i{type} @b{string};
  491. otherwise, returns @i{false}.
  492. @subsubheading Examples::
  493. @example
  494. (stringp "aaaaaa") @result{} @i{true}
  495. (stringp #\a) @result{} @i{false}
  496. @end example
  497. @subsubheading See Also::
  498. @ref{typep}
  499. ,
  500. @b{string} (@i{type})
  501. @subsubheading Notes::
  502. @example
  503. (stringp @i{object}) @equiv{} (typep @i{object} 'string)
  504. @end example
  505. @node make-string, , stringp, Strings Dictionary
  506. @subsection make-string [Function]
  507. @code{make-string} @i{size {&key} initial-element element-type} @result{} @i{string}
  508. @subsubheading Arguments and Values::
  509. @i{size}---a @i{valid array dimension}.
  510. @i{initial-element}---a @i{character}.
  511. The default is @i{implementation-dependent}.
  512. @i{element-type}---a @i{type specifier}.
  513. The default is @b{character}.
  514. @i{string}---a @i{simple string}.
  515. @subsubheading Description::
  516. @b{make-string} returns a @i{simple string} of length @i{size}
  517. whose elements have been initialized to @i{initial-element}.
  518. The @i{element-type} names the @i{type} of the @i{elements} of the @i{string};
  519. a @i{string} is constructed of the most @i{specialized}
  520. @i{type} that can accommodate @i{elements} of the given @i{type}.
  521. @subsubheading Examples::
  522. @example
  523. (make-string 10 :initial-element #\5) @result{} "5555555555"
  524. (length (make-string 10)) @result{} 10
  525. @end example
  526. @subsubheading Affected By::
  527. The @i{implementation}.
  528. @c end of including dict-strings
  529. @c %**end of chapter