all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: "Alfred M. Szmidt" <ams@gnu.org>
Cc: rms@gnu.org, emacs-devel@gnu.org
Subject: Re: Why have both `random' and `cl-random'?
Date: Sat, 10 Feb 2024 17:40:58 +0200	[thread overview]
Message-ID: <86o7cotjhx.fsf@gnu.org> (raw)
In-Reply-To: <E1rYoqN-0005Zm-Ao@fencepost.gnu.org> (ams@gnu.org)

> 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.



      reply	other threads:[~2024-02-10 15:40 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-09  3:49 Why have both `random' and `cl-random'? Richard Stallman
2024-02-09  6:43 ` Eli Zaretskii
2024-02-10  8:10 ` Alfred M. Szmidt
2024-02-10  9:27   ` Eli Zaretskii
2024-02-10 15:00     ` Alfred M. Szmidt
2024-02-10 15:40       ` Eli Zaretskii [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86o7cotjhx.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=ams@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=rms@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.