From: Tobias C. Rittweiler <tcr@fr...> - 2005-08-15 17:10:55
Trying out the tip in footnote #6 of the 20th chapter of Seibel's PCL,
I came across the following, how should I call it, quirk of SBCL:
Subsequent runs of
(let ((*random-state* (make-random-state nil)))
are described to always return the same number. Unlike CLISP which
behaves as alleged, typing the above form into SBCL's REPL multiple
times in a row, returns a new random number everytime it's run, however.
In #lisp, Christophe Rhodes commented on this issue as follows:
<Xof> tcr: the compiler probably uses RANDOM in a hash table
somewhere while compiling your successive runs
<Xof> tcr: try multiple runs of
`(let ((x (let ((*random-state* (make-random-state nil)))
(y (let ((*random-state* (make-random-state nil)))
(= x y))'
<Xof> tcr: the behaviour you describe is counterintuitive, though --
I'd probably take a patch that made a *compiler-random-state*
object for use while compiling stuff or otherwise doing
Maybe someone wants to take this over. In any case, just that this
issue has been raised and is saved in the archive.
Get latest updates about Open Source Projects, Conferences and News.