commit a05b2aeed721a75c852923c8db1430b9e9cb442e
parent 06def98d745a1722550d0e43c854b194d2eb3fb6
Author: Wolfgang Corcoran-Mathe <wcm@sigwinch.xyz>
Date: Sun, 4 Feb 2024 14:08:52 -0500
Characters: Reflow & tidy.
Diffstat:
1 file changed, 76 insertions(+), 67 deletions(-)
diff --git a/doc/r7rs-small/procedures/characters.texinfo b/doc/r7rs-small/procedures/characters.texinfo
@@ -1,19 +1,20 @@
@node Characters
@section Characters
-Characters are objects that represent printed characters such as letters and digits. All
-Scheme implementations must support at least the ASCII character repertoire: that is,
-Unicode characters U+0000 through U+007F. Implementations may support any other
-Unicode characters they see fit, and may also support non-Unicode characters as well.
-Except as otherwise specified, the result of applying any of the following procedures to a
-non-Unicode character is implementation-dependent.
+Characters are objects that represent printed characters such as
+letters and digits. All Scheme implementations must support at least the
+ASCII character repertoire: that is, Unicode characters U+0000 through
+U+007F. Implementations may support any other Unicode characters they
+see fit, and may also support non-Unicode characters as well. Except
+as otherwise specified, the result of applying any of the following
+procedures to a non-Unicode character is implementation-dependent.
-Characters are written using the notation @code{#\}@svar{character} or @code{#\}@svar{character name} or
-@code{#\x}@svar{hex scalar value}.
+Characters are written using the notation @code{#\}@svar{character}
+or @code{#\}@svar{character name} or @code{#\x}@svar{hex scalar value}.
-The following character names must be supported by all implementations with the given
-values. Implementations may add other names provided they cannot be interpreted as
-hex scalar values preceded by @code{x}.
+The following character names must be supported by all implementations
+with the given values. Implementations may add other names provided they
+cannot be interpreted as hex scalar values preceded by @code{x}.
@lisp
#\alarm @r{; U+0007}
@@ -38,23 +39,27 @@ Here are some additional examples:
#\iota @r{; @greekiota{} (if character and name are supported)}
@end lisp
-Case is significant in @code{#\}@svar{character}, and in @code{#\}⟨character name⟩, but not in
-@code{#\x}@svar{hex scalar value}. If @svar{character} in @code{#\}@svar{character} is alphabetic, then any character immediately
-following @svar{character} cannot be one that can appear in an identifier. This rule resolves
-the ambiguous case where, for example, the sequence of characters @samp{#\space} could be
-taken to be either a representation of the space character or a representation of the
-character @code{#\s} followed by a representation of the symbol @code{pace}.
-
-Characters written in the @code{#\} notation are self-evaluating. That is, they do not have to be
-quoted in programs.
-
-Some of the procedures that operate on characters ignore the
-difference between upper case and lower case. The procedures that ignore case have
+Case is significant in @code{#\}@svar{character}, and in
+@code{#\}⟨character name⟩, but not in @code{#\x}@svar{hex scalar
+value}. If @svar{character} in @code{#\}@svar{character} is alphabetic,
+then any character immediately following @svar{character} cannot be
+one that can appear in an identifier. This rule resolves the ambiguous
+case where, for example, the sequence of characters @samp{#\space}
+could be taken to be either a representation of the space character or a
+representation of the character @code{#\s} followed by a representation
+of the symbol @code{pace}.
+
+Characters written in the @code{#\} notation are self-evaluating. That
+is, they do not have to be quoted in programs.
+
+Some of the procedures that operate on characters ignore the difference
+between upper case and lower case. The procedures that ignore case have
@samp{-ci} (for ``case insensitive'') embedded in their names.
@deffn procedure char? obj
-Returns @code{#t} if @var{obj} is a character, otherwise returns @code{#f}.
+Returns @code{#t} if @var{obj} is a character, otherwise returns
+@code{#f}.
@end deffn
@@ -64,9 +69,10 @@ Returns @code{#t} if @var{obj} is a character, otherwise returns @code{#f}.
@deffnx procedure char<=? @vari{char} @varii{char} @variii{char}@dots{}
@deffnx procedure char>=? @vari{char} @varii{char} @variii{char}@dots{}
-These procedures return @code{#t} if the results of passing their arguments to @code{char->integer}
-are respectively equal, monotonically increasing, monotonically decreasing,
-monotonically non-decreasing, or monotonically non-increasing.
+These procedures return @code{#t} if the results of passing their
+arguments to @code{char->integer} are respectively equal, monotonically
+increasing, monotonically decreasing, monotonically non-decreasing, or
+monotonically non-increasing.
These predicates are required to be transitive.
@@ -78,11 +84,12 @@ These predicates are required to be transitive.
@deffnx {char library procedure} char-ci<=? @vari{char} @varii{char} @variii{char}@dots{}
@deffnx {char library procedure} char-ci>=? @vari{char} @varii{char} @variii{char}@dots{}
-These procedures are similar to @code{char=?} et cetera, but they treat upper case and lower
-case letters as the same. For example, @code{(char-ci=? #\A #\a)} returns @code{#t}.
+These procedures are similar to @code{char=?} et cetera, but they treat
+upper case and lower case letters as the same. For example,
+@code{(char-ci=? #\A #\a)} returns @code{#t}.
-Specifically, these procedures behave as if @code{char-foldcase} were applied to their
-arguments before they were compared.
+Specifically, these procedures behave as if @code{char-foldcase} were
+applied to their arguments before they were compared.
@end deffn
@@ -92,24 +99,26 @@ arguments before they were compared.
@deffnx {char library procedure} char-upper-case? letter
@deffnx {char library procedure} char-lower-case? letter
-These procedures return @code{#t} if their arguments are alphabetic, numeric, whitespace,
-upper case, or lower case characters, respectively, otherwise they return @code{#f}.
+These procedures return @code{#t} if their arguments are alphabetic,
+numeric, whitespace, upper case, or lower case characters, respectively,
+otherwise they return @code{#f}.
-Specifically,
-they must return @code{#t} when applied to characters with the Unicode properties Alphabetic,
-Numeric_Type=Decimal, White_Space, Uppercase, and Lowercase respectively, and @code{#f}
-when applied to any other Unicode characters. Note that many Unicode characters are
+Specifically, they must return @code{#t} when applied to characters with
+the Unicode properties Alphabetic, Numeric_Type=Decimal, White_Space,
+Uppercase, and Lowercase respectively, and @code{#f} when applied to
+any other Unicode characters. Note that many Unicode characters are
alphabetic but neither upper nor lower case.
@end deffn
@deffn {char library procedure} digit-value char
-This procedure returns the numeric value (0 to 9) of its argument if it is a numeric digit
-(that is, if @code{char-numeric?} returns @code{#t}), or @code{#f} on any other character.
+This procedure returns the numeric value (0 to 9) of its argument if it
+is a numeric digit (that is, if @code{char-numeric?} returns
+@code{#t}), or @code{#f} on any other character.
@lisp
-(digit-value #\3) @result{} 3
+(digit-value #\3) @result{} 3
(digit-value #\x0664) @result{} 4
(digit-value #\x0AE6) @result{} 0
(digit-value #\x0EA6) @result{} #f
@@ -119,19 +128,16 @@ This procedure returns the numeric value (0 to 9) of its argument if it is a num
@deffn procedure char->integer char
@deffnx procedure integer->char n
-Given a Unicode character,
-@code{char->integer} returns an exact integer
-between 0 and @code{#xD7FF} or
-between @code{#xE000} and @code{#x10FFFF}
-which is equal to the Unicode scalar value of that character.
-Given a non-Unicode character,
-it returns an exact integer greater than @code{#x10FFFF}.
-This is true independent of whether the implementation uses
-the Unicode representation internally.
+Given a Unicode character, @code{char->integer} returns an exact
+integer between 0 and @code{#xD7FF} or between @code{#xE000} and
+@code{#x10FFFF} which is equal to the Unicode scalar value of that
+character. Given a non-Unicode character, it returns an exact integer
+greater than @code{#x10FFFF}. This is true independent of whether the
+implementation uses the Unicode representation internally.
-Given an exact integer that is the value returned by
-a character when @code{char->integer} is applied to it, @code{integer->char}
-returns that character.
+Given an exact integer that is the value returned by a character when
+@code{char->integer} is applied to it, @code{integer->char} returns
+that character.
@end deffn
@@ -139,26 +145,29 @@ returns that character.
@deffnx {char library procedure} char-downcase char
@deffnx {char library procedure} char-foldcase char
-The @code{char-upcase} procedure, given an argument that is the
-lowercase part of a Unicode casing pair, returns the uppercase member
-of the pair, provided that both characters are supported by the Scheme
-implementation. Note that language-sensitive casing pairs are not used. If the
-argument is not the lowercase member of such a pair, it is returned.
+The @code{char-upcase} procedure, given an argument that is the lowercase
+part of a Unicode casing pair, returns the uppercase member of the pair,
+provided that both characters are supported by the Scheme implementation.
+Note that language-sensitive casing pairs are not used. If the argument
+is not the lowercase member of such a pair, it is returned.
-The @code{char-downcase} procedure, given an argument that is the
-uppercase part of a Unicode casing pair, returns the lowercase member
-of the pair, provided that both characters are supported by the Scheme
-implementation. Note that language-sensitive casing pairs are not used. If the
-argument is not the uppercase member of such a pair, it is returned.
+The @code{char-downcase} procedure, given an argument that is
+the uppercase part of a Unicode casing pair, returns the lowercase
+member of the pair, provided that both characters are supported by the
+Scheme implementation. Note that language-sensitive casing pairs are
+not used. If the argument is not the uppercase member of such a pair,
+it is returned.
The @code{char-foldcase} procedure applies the Unicode simple
case-folding algorithm to its argument and returns the result. Note that
language-sensitive folding is not used. If the argument is an uppercase
-letter, the result will be either a lowercase letter
-or the same as the argument if the lowercase letter does not exist or
-is not supported by the implementation.
-See UAX #29 (part of the Unicode Standard) for details.
+letter, the result will be either a lowercase letter or the same as the
+argument if the lowercase letter does not exist or is not supported
+by the implementation. See UAX #29 (part of the Unicode Standard)
+for details.
@c cite{uax29}
-Note that many Unicode lowercase characters do not have uppercase equivalents.
+Note that many Unicode lowercase characters do not have uppercase
+equivalents.
+
@end deffn