Subject: RE: [clisp-list] Random function

From: "Justice, Randy -CONT" <[email-masked]>
Date: Wed, 15 Nov 2000 08:53:54 -0600

I lost sleep last night over this problem.

Thank You.

Randy 

-----Original Message-----
From: Bruno Haible [mailto:[email-masked]]
Sent: Wednesday, November 15, 2000 9:00 AM
To: Justice, Randy -CONT
Cc: [email-masked]
Subject: RE: [clisp-list] Random function

Justice, Randy -CONT writes:

>    Let me give you an example. I start lisp. 
>    (random 1000) => 824
>    (random 1000) => 10
>    (random 1000) => 250
>    (random 1000) => 267
> 
> I restart the machine and restart lisp.
>    (random 1000) => 824
>    (random 1000) => 10
>    (random 1000) => 250
>    (random 1000) => 267
> 
> I get the same results.

Ah, I see what you mean. The problem is that the *random-state* value
is contained in the lisp image, and each time you start the same lisp
image, the *random-state* value is the same.

You might want to add

    (setq *random-state* (make-random-state t))

to your $HOME/.clisprc file.

Bruno
_______________________________________________
clisp-list mailing list
[email-masked]
http://lists.sourceforge.net/mailman/listinfo/clisp-list