Unfinished work on figures Data Types and Condition Types.
[clqr.git] / clqr-strings.tex
blobd4eca5781f696e0c1326640898c8e7fc83c258d4
1 % Copyright (C) 2008 Bert Burgemeister
3 % Permission is granted to copy, distribute and/or modify this
4 % document under the terms of the GNU Free Documentation License,
5 % Version 1.2 or any later version published by the Free Software
6 % Foundation; with no Invariant Sections, no Front-Cover Texts and
7 % no Back-Cover Texts. For details see file COPYING.
10 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11 \section{Strings}
12 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
13 Strings can as well be manipulated by array and sequence functions,
14 see pages \pageref{section:Arrays} and \pageref{section:Sequences}.
16 \begin{LIST}{1cm}
19 \IT{\arrGOO{(\FU*{STRINGP} \VAR{ foo})\\
20 (\FU*{SIMPLE-STRING-P} \VAR{ foo})}{.}}
22 \retval{\T} if \VAR{foo} is of indicated type.
25 \IT{(\xorGOO{\FU*{STRING=}\\\FU*{STRING-EQUAL}}{\}} \VAR{foo}
26 \VAR{bar}
27 \orGOO{\kwd{:start1} \VAR{ start-foo}\DF{\LIT{0}}\\
28 \kwd{:start2} \VAR{ start-bar}\DF{\LIT{0}}\\
29 \kwd{:end1} \VAR{ end-foo}\DF{\NIL}\\
30 \kwd{:end2} \VAR{ end-bar}\DF{\NIL}}{\}})}
32 Return \retval{\T} if
33 subsequences of \VAR{foo} and \VAR{bar} are equal. Obey/ignore,
34 respectively, case.
37 \IT{(\xorGOO{\FU*{STRING/=}\\\FU{STRING\boldmath$>$}\\
38 \FU{STRING\boldmath$>$=}\\\FU{STRING\boldmath$<$}\\
39 \FU{STRING\boldmath$<$=}}{\}} \VAR{foo} \VAR{bar}
40 \orGOO{\kwd{:start1} \VAR{ start-foo}\DF{\LIT{0}}\\
41 \kwd{:start2} \VAR{ start-bar}\DF{\LIT{0}}\\
42 \kwd{:end1} \VAR{ end-foo}\DF{\NIL}\\
43 \kwd{:end2} \VAR{ end-bar}\DF{\NIL}}{\}})}
45 \index{STRING>@STRING$>$}%
46 \index{STRING>=@STRING$>$=}%
47 \index{STRING<@STRING$<$}%
48 \index{STRING<=@STRING$<$=}%
49 If \VAR{foo} is
50 lexicographically not equal, greater, not less, less, or not greater,
51 respectively, then return \retval{character number} from beginning of \VAR{foo}
52 where they begin to differ. Otherwise return \retval{\NIL}.
55 \IT{(\xorGOO{\FU*{STRING-NOT-EQUAL}\\
56 \FU*{STRING-GREATERP}\\
57 \FU*{STRING-NOT-LESSP}\\
58 \FU*{STRING-LESSP}\\
59 \FU*{STRING-NOT-GREATERP}}{\}}
60 \VAR{foo} \VAR{bar}
61 \orGOO{%
62 \kwd{:start1} \VAR{ start-foo}\DF{\LIT{0}}\\
63 \kwd{:start2} \VAR{ start-bar}\DF{\LIT{0}}\\
64 \kwd{:end1} \VAR{ end-foo}\DF{\NIL}\\
65 \kwd{:end2} \VAR{ end-bar}\DF{\NIL}}{\}})}
67 If \VAR{foo} is
68 lexicographically not equal, greater, not less, less, or not greater,
69 respectively, ignoring case, then return \retval{character number} from beginning of \VAR{foo}
70 where they begin to differ. Otherwise return \retval{\NIL}.
73 \IT{(\FU*{STRING} \VAR{x})}
75 Convert \VAR{x} (\kwd{symbol}, \kwd{string}, or \kwd{character})
76 into a \retval{string}.
79 \IT{(\FU*{MAKE-STRING} \VAR{size} \orGOO{\kwd{:initial-element} \VAR{ char}\\
80 \kwd{:element-type} \VAR{ type}\DF{\kwd{character}}}{\}})}
82 Return \retval{string} of length \VAR{size}.
85 \IT{(\xorGOO{\FU{STRING}\\
86 \FU{NSTRING}}{\}}\kwd{-}\xorGOO{\kwd{CAPITALIZE}\\
87 \kwd{UPCASE}\\
88 \kwd{DOWNCASE}}{\}}
89 \VAR{string}
90 \orGOO{\kwd{:start} \VAR{ start}\DF{\LIT{0}}\\
91 \kwd{:end} \VAR{ end}\DF{\NIL}}{\}})}
93 \index{STRING-CAPITALIZE}%
94 \index{STRING-UPCASE}%
95 \index{STRING-DOWNCASE}%
96 \index{NSTRING-CAPITALIZE}%
97 \index{NSTRING-UPCASE}%
98 \index{NSTRING-DOWNCASE}%
99 Return \retval{\VAR{string}} (not modified or modified, respectively) with
100 first letter of every word turned into uppercase, letters all
101 uppercase, or letters all lowercase, respectively.
104 \IT{(\xorGOO{\FU*{STRING-TRIM}\\
105 \FU*{STRING-LEFT-TRIM}\\
106 \FU*{STRING-RIGHT-TRIM}}{\}} \VAR{char-bag} \VAR{string})}
108 Return \retval{\VAR{string}} with all characters in sequence \VAR{char-bag} removed
109 from both ends, from the beginning, or from the end, respectively.
112 \IT{\arrGOO{(\FU*{CHAR} \VAR{ string} \VAR{ i})\\
113 (\FU*{SCHAR} \VAR{ string} \VAR{ i})}{.}}
115 Return zero-indexed \retval{\VAR{i}th character} of string ignoring/obeying,
116 respectively, fill pointer. \kwd{setf}able.
119 \IT{(\FU*{PARSE-INTEGER} \VAR{string}
120 \orGOO{\kwd{:start} \VAR{ start}\DF{\LIT{0}}\\
121 \kwd{:end} \VAR{ end}\DF{\NIL}\\
122 \kwd{:radix} \VAR{ int}\DF{\LIT{10}}\\
123 \kwd{:junk-allowed} \VAR{ bool}\DF{\NIL}}{\}})}
125 Return \retval{integer} parsed from \VAR{string} and \retvalii{index} of parse end.
130 \end{LIST}
132 %%% Local Variables:
133 %%% mode: latex
134 %%% TeX-master: "clqr"
135 %%% End: