A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://www.lispworks.com/documentation/HyperSpec/Body/v_rnd_st.htm below:

CLHS: Variable *RANDOM-STATE*

CLHS: Variable *RANDOM-STATE* Variable *RANDOM-STATE*

Value Type:

a random state.

Initial Value:

implementation-dependent.

Description:

The current random state, which is used, for example, by the function random when a random state is not explicitly supplied.

Examples:

 (random-state-p *random-state*) =>  true
 (setq snap-shot (make-random-state))
 ;; The series from any given point is random,
 ;; but if you backtrack to that point, you get the same series.
 (list (loop for i from 1 to 10 collect (random))
       (let ((*random-state* snap-shot))
         (loop for i from 1 to 10 collect (random)))
       (loop for i from 1 to 10 collect (random))
       (let ((*random-state* snap-shot))
         (loop for i from 1 to 10 collect (random))))
=>  ((19 16 44 19 96 15 76 96 13 61)
    (19 16 44 19 96 15 76 96 13 61)
    (16 67 0 43 70 79 58 5 63 50)
    (16 67 0 43 70 79 58 5 63 50))

Affected By:

The implementation.

random.

See Also:

make-random-state, random, random-state

Notes:

Binding *random-state* to a different random state object correctly saves and restores the old random state object.


Copyright 1996-2005, LispWorks Ltd. All rights reserved.

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4