@c Free Software Foundation, Inc.
@c See the file guile.texi for copying conditions.
-@page
@node Simple Data Types
@section Simple Generic Data Types
@subsubsection Random Number Generation
Pseudo-random numbers are generated from a random state object, which
-can be created with @code{seed->random-state}. The @var{state}
-parameter to the various functions below is optional, it defaults to
-the state object in the @code{*random-state*} variable.
+can be created with @code{seed->random-state} or
+@code{datum->random-state}. An external representation (i.e. one
+which can written with @code{write} and read with @code{read}) of a
+random state object can be obtained via
+@code{random-state->datum}. The @var{state} parameter to the
+various functions below is optional, it defaults to the state object
+in the @code{*random-state*} variable.
@deffn {Scheme Procedure} copy-random-state [state]
@deffnx {C Function} scm_copy_random_state (state)
Return a new random state using @var{seed}.
@end deffn
+@deffn {Scheme Procedure} datum->random-state datum
+@deffnx {C Function} scm_datum_to_random_state (datum)
+Return a new random state from @var{datum}, which should have been
+obtained by @code{random-state->datum}.
+@end deffn
+
+@deffn {Scheme Procedure} random-state->datum state
+@deffnx {C Function} scm_random_state_to_datum (state)
+Return a datum representation of @var{state} that may be written out and
+read back with the Scheme reader.
+@end deffn
+
@defvar *random-state*
The global random state used by the above functions when the
@var{state} parameter is not given.
be written with as an octal number, such as @code{#\10} for
@code{#\bs} or @code{#\177} for @code{#\del}.
-When the @code{r6rs-hex-escapes} reader option is enabled, there is an
-additional syntax for character escapes: @code{#\xHHHH} -- the letter 'x'
-followed by a hexadecimal number of one to eight digits.
-
-@lisp
-(read-enable 'r6rs-hex-escapes)
-@end lisp
-
-Enabling this option will also change the hex escape format for strings. More
-on string escapes can be found at (@pxref{String Syntax}). More on reader
-options in general can be found at (@pxref{Reader options}).
+If one prefers hex to octal, there is an additional syntax for character
+escapes: @code{#\xHHHH} -- the letter 'x' followed by a hexadecimal
+number of one to eight digits.
@rnindex char?
@deffn {Scheme Procedure} char? x
(read-enable 'r6rs-hex-escapes)
@end lisp
-Enabling this option will also change the hex escape format for characters.
-More on character escapes can be found at (@pxref{Characters}). More on
-reader options in general can be found at (@pxref{Reader options}).
+More on reader options in general can be found at (@pxref{Reader
+options}).
@node String Predicates
@subsubsection String Predicates
@cindex bytevector
@cindex R6RS
-A @dfn{bytevector} is a raw bit string. The @code{(rnrs bytevector)}
+A @dfn{bytevector} is a raw bit string. The @code{(rnrs bytevectors)}
module provides the programming interface specified by the
@uref{http://www.r6rs.org/, Revised^6 Report on the Algorithmic Language
Scheme (R6RS)}. It contains procedures to manipulate bytevectors and
@subsection ``Functionality-Centric'' Data Types
Procedures and macros are documented in their own chapter: see
-@ref{Procedures and Macros}.
+@ref{Procedures} and @ref{Macros}.
Variable objects are documented as part of the description of Guile's
module system: see @ref{Variables}.