update docs

* doc/ref/api-data.texi:
* libguile/random.c: Update datum->random-state and random-state->datum
  docs.
This commit is contained in:
Andy Wingo 2010-07-26 15:12:42 +02:00
commit 1d454874c1
2 changed files with 12 additions and 18 deletions

View file

@ -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*

View file

@ -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));