unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
* doc *random-state*
@ 2003-11-11  0:23 Kevin Ryde
  0 siblings, 0 replies; only message in thread
From: Kevin Ryde @ 2003-11-11  0:23 UTC (permalink / raw)


[-- Attachment #1: Type: text/plain, Size: 571 bytes --]

        * scheme-data.texi (Random): Add *random-state* variable, put note at
        the top of the node about it being the default, rather than just in
        the description of random.


Pseudo-random numbers are generated from a random state object, which
can be created with `seed->random-state'.  The STATE parameter to the
various functions below is optional, it defaults to the state object in
the `*random-state*' variable.

...

 - Variable: *random-state*
     The global random state used by the above functions when the STATE
     parameter is not given.



[-- Attachment #2: scheme-data.texi.random.diff --]
[-- Type: text/plain, Size: 1388 bytes --]

--- scheme-data.texi.~1.38.~	1970-01-01 10:00:01.000000000 +1000
+++ scheme-data.texi	2003-11-11 10:21:08.000000000 +1000
@@ -1229,6 +1229,11 @@
 @node Random
 @subsection 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.
+
 @deffn {Scheme Procedure} copy-random-state [state]
 @deffnx {C Function} scm_copy_random_state (state)
 Return a copy of the random state @var{state}.
@@ -1242,12 +1247,6 @@
 number of the same type between zero (inclusive) and
 @var{n} (exclusive). The values returned have a uniform
 distribution.
-
-The optional argument @var{state} must be of the type produced
-by @code{seed->random-state}. It defaults to the value of the
-variable @code{*random-state*}. This object is used to maintain
-the state of the pseudo-random-number generator and is altered
-as a side effect of the random operation.
 @end deffn
 
 @deffn {Scheme Procedure} random:exp [state]
@@ -1302,6 +1301,11 @@
 Return a new random state using @var{seed}.
 @end deffn
 
+@defvar *random-state*
+The global random state used by the above functions when the
+@var{state} parameter is not given.
+@end defvar
+
 
 @node Characters
 @section Characters

[-- Attachment #3: Type: text/plain, Size: 142 bytes --]

_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-devel

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-11-11  0:23 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-11-11  0:23 doc *random-state* Kevin Ryde

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).