commit ab8e87625ad6f290f00d425b50e3d0e529b7724a
parent 681f05bfcca1243be688c10e6087869c2215e468
Author: Wolfgang Corcoran-Mathe <wcm@sigwinch.xyz>
Date: Sun, 4 Feb 2024 21:14:24 -0500
Bytevectors: Reflow & tidy.
Diffstat:
1 file changed, 50 insertions(+), 50 deletions(-)
diff --git a/doc/r7rs-small/procedures/bytevectors.texinfo b/doc/r7rs-small/procedures/bytevectors.texinfo
@@ -1,43 +1,43 @@
@node Bytevectors
@section Bytevectors
-@dfn{Bytevectors} represent blocks of binary data.
-They are fixed-length sequences of bytes, where
-a @dfn{byte} is an exact integer in the range from 0 to 255 inclusive.
-A bytevector is typically more space-efficient than a vector
-containing the same values.
+@dfn{Bytevectors} represent blocks of binary data. They are fixed-length
+sequences of bytes, where a @dfn{byte} is an exact integer in the range
+from 0 to 255 inclusive. A bytevector is typically more space-efficient
+than a vector containing the same values.
The @dfn{length} of a bytevector is the number of elements that it
contains. This number is a non-negative integer that is fixed when
-the bytevector is created. The @dfn{valid indexes} of
-a bytevector are the exact non-negative integers less than the length of the
-bytevector, starting at index zero as with vectors.
+the bytevector is created. The @dfn{valid indexes} of a bytevector are
+the exact non-negative integers less than the length of the bytevector,
+starting at index zero as with vectors.
-Bytevectors are written using the notation @code{#u8(}@var{byte} @dots{}@code{)}.
-For example, a bytevector of length 3 containing the byte 0 in element
-0, the byte 10 in element 1, and the byte 5 in
-element 2 can be written as follows:
+Bytevectors are written using the notation @code{#u8(}@var{byte}
+@dots{}@code{)}. For example, a bytevector of length 3 containing the
+byte 0 in element 0, the byte 10 in element 1, and the byte 5 in element
+2 can be written as follows:
@lisp
#u8(0 10 5)
@end lisp
-Bytevector constants are self-evaluating, so they do not need to be quoted in programs.
+Bytevector constants are self-evaluating, so they do not need to be
+quoted in programs.
@deffn procedure bytevector? obj
-Returns @code{#t} if @var{obj} is a bytevector.
-Otherwise, @code{#f} is returned.
+Returns @code{#t} if @var{obj} is a bytevector. Otherwise, @code{#f} is
+returned.
@end deffn
@deffn procedure make-bytevector k
@deffnx procedure make-bytevector k byte
-The @code{make-bytevector} procedure returns a newly allocated bytevector of
-length @var{k}. If @var{byte} is given, then all elements of the bytevector
-are initialized to @var{byte}, otherwise the contents of each
-element are unspecified.
+The @code{make-bytevector} procedure returns a newly allocated
+bytevector of length @var{k}. If @var{byte} is given, then all elements
+of the bytevector are initialized to @var{byte}, otherwise the contents
+of each element are unspecified.
@lisp
(make-bytevector 2 12) @result{} #u8(12 12)
@@ -50,16 +50,15 @@ element are unspecified.
Returns a newly allocated bytevector containing its arguments.
@lisp
-(bytevector 1 3 5 1 3 5) @result{} #u8(1 3 5 1 3 5)
-(bytevector) @result{} #u8()
+(bytevector 1 3 5 1 3 5) @result{} #u8(1 3 5 1 3 5)
+(bytevector) @result{} #u8()
@end lisp
@end deffn
@deffn procedure bytevector-length bytevector
-Returns the length of
-@var{bytevector} in bytes as an exact integer.
+Returns the length of @var{bytevector} in bytes as an exact integer.
@end deffn
@@ -72,7 +71,7 @@ Returns the @var{k}th byte of @var{bytevector}.
@lisp
(bytevector-u8-ref '#u8(1 1 2 3 5 8 13 21)
5)
-@result{} 8
+ @result{} 8
@end lisp
@end deffn
@@ -87,7 +86,7 @@ Stores @var{byte} as the @var{k}th byte of @var{bytevector}.
(let ((bv (bytevector 1 2 3 4)))
(bytevector-u8-set! bv 1 3)
bv)
-@result{} #u8(1 3 3 4)
+ @result{} #u8(1 3 3 4)
@end lisp
@end deffn
@@ -96,8 +95,8 @@ Stores @var{byte} as the @var{k}th byte of @var{bytevector}.
@deffnx procedure bytevector-copy bytevector start
@deffnx procedure bytevector-copy bytevector start end
-Returns a newly allocated bytevector containing the bytes in @var{bytevector}
-between @var{start} and @var{end}.
+Returns a newly allocated bytevector containing the bytes in
+@var{bytevector} between @var{start} and @var{end}.
@lisp
(define a #u8(1 2 3 4 5))
@@ -110,17 +109,18 @@ between @var{start} and @var{end}.
@deffnx procedure bytevector-copy! to at from start
@deffnx procedure bytevector-copy! to at from start end
-It is an error if @var{at} is less than zero or greater than the length of @var{to}.
-It is also an error if @code{(- (bytevector-length }@var{to}@code{)} @var{at}@code{)}
-is less than @code{(- }@var{end} @var{start}@code{)}.
+It is an error if @var{at} is less than zero or greater than the length
+of @var{to}. It is also an error if
+@code{(- (bytevector-length }@var{to}@code{)} @var{at}@code{)} is less
+than @code{(- }@var{end} @var{start}@code{)}.
-Copies the bytes of bytevector @var{from} between @var{start} and @var{end}
-to bytevector @var{to}, starting at @var{at}. The order in which bytes are
-copied is unspecified, except that if the source and destination overlap,
-copying takes place as if the source is first copied into a temporary
-bytevector and then into the destination. This can be achieved without
-allocating storage by making sure to copy in the correct direction in
-such circumstances.
+Copies the bytes of bytevector @var{from} between @var{start} and
+@var{end} to bytevector @var{to}, starting at @var{at}. The order in
+which bytes are copied is unspecified, except that if the source and
+destination overlap, copying takes place as if the source is first
+copied into a temporary bytevector and then into the destination.
+This can be achieved without allocating storage by making sure to
+copy in the correct direction in such circumstances.
@lisp
(define a (bytevector 1 2 3 4 5))
@@ -129,8 +129,9 @@ such circumstances.
b @result{} #u8(10 1 2 40 50)
@end lisp
-Note: This procedure appears in @rsixrs{}, but places the source before the destination,
- contrary to other such procedures in Scheme.
+Note: This procedure appears in @rsixrs{}, but places the source
+before the destination, contrary to other such procedures in Scheme.
+
@end deffn
@deffn procedure bytevector-append bytevector@dots{}
@@ -140,7 +141,7 @@ elements in the given @var{bytevector}s.
@lisp
(bytevector-append #u8(0 1 2) #u8(3 4 5))
-@result{} #u8(0 1 2 3 4 5)
+ @result{} #u8(0 1 2 3 4 5)
@end lisp
@end deffn
@@ -152,19 +153,18 @@ elements in the given @var{bytevector}s.
@deffnx procedure string->utf8 string start
@deffnx procedure string->utf8 string start end
-It is an error for @var{bytevector} to contain invalid UTF-8 byte sequences.
+It is an error for @var{bytevector} to contain invalid UTF-8 byte
+sequences.
-These procedures translate between strings and bytevectors
-that encode those strings using the UTF-8 encoding.
-The @code{utf8->string} procedure decodes the bytes of
-a bytevector between @var{start} and @var{end}
-and returns the corresponding string;
-the @code{string->utf8} procedure encodes the characters of a
-string between @var{start} and @var{end}
-and returns the corresponding bytevector.
+These procedures translate between strings and bytevectors that encode
+those strings using the UTF-8 encoding. The @code{utf8->string}
+procedure decodes the bytes of a bytevector between @var{start} and
+@var{end} and returns the corresponding string; the @code{string->utf8}
+procedure encodes the characters of a string between @var{start}
+and @var{end} and returns the corresponding bytevector.
@lisp
-(utf8->string #u8(#x41)) @result{} "A"
+(utf8->string #u8(#x41)) @result{} "A"
(string->utf8 "@theultimate{}") @result{} #u8(#xCE #xBB)
@end lisp