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

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1104 bytes --]

   >    As far as I can tell from the doc strings, the user level funcionality
   >    of the two is the same.  If there is a difference, I can't tell it from
   >    those doc strings.  But they compute values in different ways
   > 
   >    If there is no significant user-visible difference, could the two be merged?
   > 
   > cl-random allows you to specify the seed, while random does not

   random does allow to specify the seed:

     random is a built-in function in ‘src/fns.c’.

     (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?



  reply	other threads:[~2024-02-10 15:00 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 [this message]
2024-02-10 15:40       ` Eli Zaretskii

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=E1rYoqN-0005Zm-Ao@fencepost.gnu.org \
    --to=ams@gnu.org \
    --cc=eliz@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.