diff options
-rwxr-xr-x | doc/ref/api-data.texi | 24 | ||||
-rw-r--r-- | libguile/random.c | 6 |
2 files changed, 12 insertions, 18 deletions
diff --git a/doc/ref/api-data.texi b/doc/ref/api-data.texi index db593073a..75e5e687a 100755 --- a/doc/ref/api-data.texi +++ b/doc/ref/api-data.texi @@ -1512,10 +1512,10 @@ through @var{end} (exclusive) bits of @var{n}. The Pseudo-random numbers are generated from a random state object, which can be created with @code{seed->random-state} or -@code{external->random-state}. An external representation (i.e. one +@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->external}. The @var{state} parameter to the +@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. @@ -1586,20 +1586,16 @@ Return a uniformly distributed inexact real random number in Return a new random state using @var{seed}. @end deffn -@deffn {Scheme Procedure} external->random-state external -@deffnx {C Function} scm_external_to_random_state (external) -Return a new random state from the external representation -@var{external}, which must have been obtained by -@code{random-state->external}. +@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->external state -@deffnx {C Function} scm_random_state_to_external (state) -Return an external representation of @var{state}. You cannot make -any assumtions on the structure of the returned object besides that -it will be an acceptable argument to @code{external->random-state} -and that it will be able to be written and read back by the Scheme -reader. +@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* diff --git a/libguile/random.c b/libguile/random.c index a1191898c..4586b271f 100644 --- a/libguile/random.c +++ b/libguile/random.c @@ -413,10 +413,8 @@ SCM_DEFINE (scm_seed_to_random_state, "seed->random-state", 1, 0, 0, SCM_DEFINE (scm_datum_to_random_state, "datum->random-state", 1, 0, 0, (SCM datum), - "Return a new random state using @var{datum}.\n" - "\n" - "@var{datum} must be an external state representation obtained\n" - "from @code{random-state->datum}.") + "Return a new random state using @var{datum}, which should have\n" + "been obtailed from @code{random-state->datum}.") #define FUNC_NAME s_scm_datum_to_random_state { return make_rstate (scm_c_rstate_from_datum (datum)); |