[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Why have both `random' and `cl-random'?
From: |
Eli Zaretskii |
Subject: |
Re: Why have both `random' and `cl-random'? |
Date: |
Sat, 10 Feb 2024 17:40:58 +0200 |
> From: "Alfred M. Szmidt" <ams@gnu.org>
> Cc: rms@gnu.org, emacs-devel@gnu.org
> Date: Sat, 10 Feb 2024 10:00:39 -0500
>
> (random &optional LIMIT)
>
> Return a pseudo-random integer.
> By default, return a fixnum; all fixnums are equally likely.
> With positive integer LIMIT, return random integer in interval [0,LIMIT).
> With argument t, set the random number seed from the system’s entropy
> pool if available, otherwise from less-random volatile data such as the
> time.
> With a string argument, set the seed based on the string’s contents.
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>
> Missed that, but doesn't that mean that using a limit _and_ a seed is
> not possible?
I think the idea in that case is that you first call random with a
seed (and ignore the value), and then continue calling it with a
limit. But I didn't try that, so maybe I'm missing something.