From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Kevin Ryde Newsgroups: gmane.lisp.guile.devel Subject: doc *random-state* Date: Tue, 11 Nov 2003 10:23:29 +1000 Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Message-ID: <87u15bpxby.fsf@zip.com.au> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: sea.gmane.org 1068510652 23002 80.91.224.253 (11 Nov 2003 00:30:52 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 11 Nov 2003 00:30:52 +0000 (UTC) Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Tue Nov 11 01:30:50 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1AJMQj-0000Xp-01 for ; Tue, 11 Nov 2003 01:30:50 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1AJNNz-0007SJ-Hs for guile-devel@m.gmane.org; Mon, 10 Nov 2003 20:32:03 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.24) id 1AJNNo-0007QZ-UM for guile-devel@gnu.org; Mon, 10 Nov 2003 20:31:52 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.24) id 1AJNNI-0007K6-5x for guile-devel@gnu.org; Mon, 10 Nov 2003 20:31:51 -0500 Original-Received: from [61.8.0.36] (helo=snoopy.pacific.net.au) by monty-python.gnu.org with esmtp (Exim 4.24) id 1AJNHD-0006Qc-Uo for guile-devel@gnu.org; Mon, 10 Nov 2003 20:25:04 -0500 Original-Received: from mongrel.pacific.net.au (mongrel.pacific.net.au [61.8.0.107]) by snoopy.pacific.net.au (8.12.3/8.12.3/Debian-6.6) with ESMTP id hAB0NcV0026775 for ; Tue, 11 Nov 2003 11:23:38 +1100 Original-Received: from localhost (ppp25.dyn228.pacific.net.au [203.143.228.25]) by mongrel.pacific.net.au (8.12.3/8.12.3/Debian-6.6) with ESMTP id hAB0MYDJ023812 for ; Tue, 11 Nov 2003 11:22:35 +1100 Original-Received: from gg by localhost with local (Exim 3.35 #1 (Debian)) id 1AJMJe-0002oH-00; Tue, 11 Nov 2003 10:23:30 +1000 Original-To: guile-devel@gnu.org Mail-Copies-To: never User-Agent: Gnus/5.1003 (Gnus v5.10.3) Emacs/21.3 (gnu/linux) X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Developers list for Guile, the GNU extensibility library List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: main.gmane.org gmane.lisp.guile.devel:2986 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.devel:2986 --=-=-= * 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. --=-=-= Content-Disposition: attachment; filename=scheme-data.texi.random.diff --- 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 --=-=-= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Guile-devel mailing list Guile-devel@gnu.org http://mail.gnu.org/mailman/listinfo/guile-devel --=-=-=--