@@ -5,31 +5,27 @@ The strings Library
55.. current-library :: strings
66.. current-module :: strings
77
8- The strings library exports definitions for basic string manipulation.
8+ The *strings * library exports definitions for basic string manipulation.
9+
10+ The *strings * library was originally defined in `DEP-0004
11+ <http://opendylan.org/proposals/dep-0004.html> `_. Some additional background
12+ material can be found there.
13+
14+ .. contents :: Contents
15+ :local:
916
1017.. note ::
1118
12- * This library does not address any higher-level operations such as
13- text formatting or anything that requires semantic knowledge of
14- words, such as * pluralize * .
19+ * This library does not address any higher-level operations such as text
20+ formatting or anything that requires semantic knowledge of words, such as
21+ pluralization or internationalization .
1522
1623 * Where it makes sense, functions can be applied to either a single
1724 character or a string of characters. For example, ``lowercase('C')
1825 => 'c' `` and ``lowercase("Foo") => "foo" ``.
1926
20- * Functions are case-sensitive by default. Versions that ignore
21- alphabetic case are named with a trailing "-ic" or "-ic?".
22-
23- * Open Dylan doesn't yet support Unicode. When it does, this library
24- will be updated to support it also.
25-
26- The strings library was originally defined in `DEP-0004
27- <http://opendylan.org/proposals/dep-0004.html> `_. Some additional
28- background material can be found there.
29-
30-
31- .. contents :: Contents
32- :local:
27+ * Functions are case-sensitive by default. Versions that ignore alphabetic
28+ case are named with a trailing "-ic" or "-ic?", which means "ignore case".
3329
3430
3531The strings Module
@@ -63,7 +59,7 @@ Character Class Predicates
6359
6460 alphabetic?('a') => #t
6561 alphabetic?('-') => #f
66-
62+
6763 .. method :: alphabetic?
6864 :specializer: <string>
6965 :sealed:
@@ -85,8 +81,6 @@ Character Class Predicates
8581 alphabetic?("abc") => #t
8682 alphabetic?("abc123") => #f
8783 alphabetic?("abc123", end: 3) => #t
88-
89- ------------
9084
9185 .. generic-function :: alphanumeric?
9286 :sealed:
@@ -133,8 +127,6 @@ Character Class Predicates
133127 alphanumeric?("abc...") => #f
134128 alphanumeric?("abc...", end: 3) => #t
135129
136- ------------
137-
138130 .. generic-function :: control?
139131 :sealed:
140132
@@ -184,8 +176,6 @@ Character Class Predicates
184176 control?("abc\0") => #f
185177 control?("abc\0", start: 3) => #t
186178
187- ------------
188-
189179 .. generic-function :: graphic?
190180 :sealed:
191181
@@ -237,8 +227,6 @@ Character Class Predicates
237227 graphic?("ABC\n") => #f
238228 graphic?("ABC\n", end: 3) => #t
239229
240- ------------
241-
242230 .. generic-function :: printable?
243231 :sealed:
244232
@@ -291,8 +279,6 @@ Character Class Predicates
291279 printable?("abc\0") => #f
292280 printable?("abc\0", end: 3) => #t
293281
294- ------------
295-
296282 .. generic-function :: whitespace?
297283 :sealed:
298284
@@ -344,8 +330,6 @@ Character Class Predicates
344330 whitespace?("x\t x") => #f
345331 whitespace?("x\t x", start: 1, end: 3) => #t
346332
347- ------------
348-
349333 .. generic-function :: decimal-digit?
350334 :sealed:
351335
@@ -394,8 +378,6 @@ Character Class Predicates
394378 decimal-digit?("x123y") => #f
395379 decimal-digit?("x123y", start: 1, end: 4) => #t
396380
397- ------------
398-
399381 .. generic-function :: hexadecimal-digit?
400382 :sealed:
401383
@@ -446,8 +428,6 @@ Character Class Predicates
446428 hexdecimal-digit?(" ff00 ") => #f
447429 hexdecimal-digit?(" ff00 ", start: 1, end: 5) => #t
448430
449- ------------
450-
451431 .. generic-function :: octal-digit?
452432 :sealed:
453433
@@ -631,8 +611,6 @@ Case Conversion Functions
631611 lowercase("Hack Dylan!") => "hack dylan!"
632612 lowercase("Hack Dylan!", end: 4) => "hack"
633613
634- -------------
635-
636614 .. generic-function :: lowercase!
637615 :sealed:
638616
@@ -685,8 +663,6 @@ Case Conversion Functions
685663 lowercase!("Hack Dylan!")
686664 => error, attempt to modify a string constant
687665
688- -------------
689-
690666 .. generic-function :: lowercase?
691667 :sealed:
692668
@@ -737,8 +713,6 @@ Case Conversion Functions
737713 lowercase?("Why me?", start: 1) => #t
738714 lowercase?("e.e. cummings") => #t
739715
740- -------------
741-
742716 .. generic-function :: uppercase
743717 :sealed:
744718
@@ -787,8 +761,6 @@ Case Conversion Functions
787761 uppercase("Hack Dylan!") => "HACK DYLAN!"
788762 uppercase("Hack Dylan!", end: 4) => "HACK Dylan!"
789763
790- -------------
791-
792764 .. generic-function :: uppercase!
793765 :sealed:
794766
@@ -813,7 +785,7 @@ Case Conversion Functions
813785 .. code-block :: dylan
814786
815787 uppercase!('t') => 'T'
816-
788+
817789 .. method :: uppercase!
818790 :specializer: <string>
819791 :sealed:
@@ -840,8 +812,6 @@ Case Conversion Functions
840812 uppercase!("Hack Dylan!")
841813 => error, attempt to modify a string constant
842814
843- -------------
844-
845815 .. generic-function :: uppercase?
846816 :sealed:
847817
@@ -1356,14 +1326,20 @@ Miscellaneous Functions
13561326 strip-right(" \tabc\n") => " \tabc"
13571327 strip-right("*foo*", test: curry(\=, '*')) => "*foo"
13581328
1359-
1360- Other Useful Functions
1361- ======================
13621329
1363- There are a number of functions outside the strings library itself that can be used with strings.
1330+ String Functions in Other Libraries
1331+ ===================================
13641332
1365- Built-In
1366- --------
1333+ There are a number of functions outside the strings library itself that can be
1334+ used with strings.
1335+
1336+ dylan Module
1337+ ------------
1338+
1339+ Since strings are a kind of :drm: `<sequence> `, all sequence operations apply to
1340+ strings, including most `Collection Operations
1341+ <https://opendylan.org/books/drm/Collection_Operations> `_. The ones listed
1342+ below are most frequently used for strings.
13671343
13681344.. hlist ::
13691345
@@ -1380,7 +1356,7 @@ Built-In
13801356 * :drm: `as-lowercase! `
13811357 * :drm: `as-uppercase `
13821358 * :drm: `as-uppercase! `
1383-
1359+
13841360common-extensions Module
13851361------------------------
13861362
0 commit comments