From b76d11cdd6aa75089ab8a222e15e78b26a4020ea Mon Sep 17 00:00:00 2001 From: Carl Gay Date: Wed, 18 May 2022 02:08:56 +0000 Subject: [PATCH] Various minor doc improvements * Move note below Contents * Remove horizontal lines (they were practically invisible anyway) * Remove trailing whitespace * Remove note about Unicode; it's not really relevant here. * Explain what "ic" stands for. * Revamp the Other Useful Functions a bit --- documentation/source/index.rst | 80 ++++++++++++---------------------- 1 file changed, 28 insertions(+), 52 deletions(-) diff --git a/documentation/source/index.rst b/documentation/source/index.rst index 936b8c9..4a6a9ca 100644 --- a/documentation/source/index.rst +++ b/documentation/source/index.rst @@ -5,31 +5,27 @@ The strings Library .. current-library:: strings .. current-module:: strings -The strings library exports definitions for basic string manipulation. +The *strings* library exports definitions for basic string manipulation. + +The *strings* library was originally defined in `DEP-0004 +`_. Some additional background +material can be found there. + +.. contents:: Contents + :local: .. note:: - * This library does not address any higher-level operations such as - text formatting or anything that requires semantic knowledge of - words, such as *pluralize*. + * This library does not address any higher-level operations such as text + formatting or anything that requires semantic knowledge of words, such as + pluralization or internationalization. * Where it makes sense, functions can be applied to either a single character or a string of characters. For example, ``lowercase('C') => 'c'`` and ``lowercase("Foo") => "foo"``. - * Functions are case-sensitive by default. Versions that ignore - alphabetic case are named with a trailing "-ic" or "-ic?". - - * Open Dylan doesn't yet support Unicode. When it does, this library - will be updated to support it also. - -The strings library was originally defined in `DEP-0004 -`_. Some additional -background material can be found there. - - -.. contents:: Contents - :local: + * Functions are case-sensitive by default. Versions that ignore alphabetic + case are named with a trailing "-ic" or "-ic?", which means "ignore case". The strings Module @@ -63,7 +59,7 @@ Character Class Predicates alphabetic?('a') => #t alphabetic?('-') => #f - + .. method:: alphabetic? :specializer: :sealed: @@ -85,8 +81,6 @@ Character Class Predicates alphabetic?("abc") => #t alphabetic?("abc123") => #f alphabetic?("abc123", end: 3) => #t - ------------- .. generic-function:: alphanumeric? :sealed: @@ -133,8 +127,6 @@ Character Class Predicates alphanumeric?("abc...") => #f alphanumeric?("abc...", end: 3) => #t ------------- - .. generic-function:: control? :sealed: @@ -184,8 +176,6 @@ Character Class Predicates control?("abc\0") => #f control?("abc\0", start: 3) => #t ------------- - .. generic-function:: graphic? :sealed: @@ -237,8 +227,6 @@ Character Class Predicates graphic?("ABC\n") => #f graphic?("ABC\n", end: 3) => #t ------------- - .. generic-function:: printable? :sealed: @@ -291,8 +279,6 @@ Character Class Predicates printable?("abc\0") => #f printable?("abc\0", end: 3) => #t ------------- - .. generic-function:: whitespace? :sealed: @@ -344,8 +330,6 @@ Character Class Predicates whitespace?("x\t x") => #f whitespace?("x\t x", start: 1, end: 3) => #t ------------- - .. generic-function:: decimal-digit? :sealed: @@ -394,8 +378,6 @@ Character Class Predicates decimal-digit?("x123y") => #f decimal-digit?("x123y", start: 1, end: 4) => #t ------------- - .. generic-function:: hexadecimal-digit? :sealed: @@ -446,8 +428,6 @@ Character Class Predicates hexdecimal-digit?(" ff00 ") => #f hexdecimal-digit?(" ff00 ", start: 1, end: 5) => #t ------------- - .. generic-function:: octal-digit? :sealed: @@ -631,8 +611,6 @@ Case Conversion Functions lowercase("Hack Dylan!") => "hack dylan!" lowercase("Hack Dylan!", end: 4) => "hack" -------------- - .. generic-function:: lowercase! :sealed: @@ -685,8 +663,6 @@ Case Conversion Functions lowercase!("Hack Dylan!") => error, attempt to modify a string constant -------------- - .. generic-function:: lowercase? :sealed: @@ -737,8 +713,6 @@ Case Conversion Functions lowercase?("Why me?", start: 1) => #t lowercase?("e.e. cummings") => #t -------------- - .. generic-function:: uppercase :sealed: @@ -787,8 +761,6 @@ Case Conversion Functions uppercase("Hack Dylan!") => "HACK DYLAN!" uppercase("Hack Dylan!", end: 4) => "HACK Dylan!" -------------- - .. generic-function:: uppercase! :sealed: @@ -813,7 +785,7 @@ Case Conversion Functions .. code-block:: dylan uppercase!('t') => 'T' - + .. method:: uppercase! :specializer: :sealed: @@ -840,8 +812,6 @@ Case Conversion Functions uppercase!("Hack Dylan!") => error, attempt to modify a string constant -------------- - .. generic-function:: uppercase? :sealed: @@ -1356,14 +1326,20 @@ Miscellaneous Functions strip-right(" \tabc\n") => " \tabc" strip-right("*foo*", test: curry(\=, '*')) => "*foo" - -Other Useful Functions -====================== -There are a number of functions outside the strings library itself that can be used with strings. +String Functions in Other Libraries +=================================== -Built-In --------- +There are a number of functions outside the strings library itself that can be +used with strings. + +dylan Module +------------ + +Since strings are a kind of :drm:``, all sequence operations apply to +strings, including most `Collection Operations +`_. The ones listed +below are most frequently used for strings. .. hlist:: @@ -1380,7 +1356,7 @@ Built-In * :drm:`as-lowercase!` * :drm:`as-uppercase` * :drm:`as-uppercase!` - + common-extensions Module ------------------------