zsh-workers
 help / color / mirror / code / Atom feed
From: Clinton Bunch <cdb_zsh@zentaur.org>
To: zsh-workers@zsh.org
Subject: Re: use of rand() in zsh
Date: Tue, 11 Oct 2022 07:51:07 -0500	[thread overview]
Message-ID: <81965a4f-fff9-5a14-fac1-784ac46a6667@zentaur.org> (raw)
In-Reply-To: <CAN=4vMr+aY5+JP1dRwz9VM49t-EZ1NjV7N8Wd+Zj0GXrZETTmg@mail.gmail.com>

On 10/11/2022 1:31 AM, Roman Perepelitsa wrote:
>
> I would use it, and I think most uses of $RANDOM would be better off
> as $SRANDOM.
>
> In the meantime I'm using this:
> https://gist.github.com/romkatv/a6cede40714ec77d4da73605c5ddb36a
>
> Roman.
>
The question then is how should it be implemented:

1. Implement a shopt that changed the behavior of RANDOM (Pleasing 
because of the elegance of using RANDOM for good random values, but 
probably too confusing)

2. Simply implement a new parameter called SRANDOM (simplest, but change 
to core zsh interface)

3. Write a module (e.g. zsh/random) that introduced a new special 
parameter when loaded (more complicated, but isolated to those who want 
it and possible to fail on systems that don't have a kernel entropy pool)



  reply	other threads:[~2022-10-11 12:51 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-10 23:32 Clinton Bunch
2022-10-11  1:14 ` Bart Schaefer
2022-10-11  1:27   ` Clinton Bunch
2022-10-11  1:32     ` Clinton Bunch
2022-10-11  3:34       ` Bart Schaefer
2022-10-11  3:44         ` Clinton Bunch
2022-10-11  6:31           ` Roman Perepelitsa
2022-10-11 12:51             ` Clinton Bunch [this message]
2022-10-11 13:23               ` Peter Stephenson
2022-10-11 14:15                 ` Clinton Bunch
2022-10-11 14:48                   ` Peter Stephenson
2022-10-11 12:35   ` Clinton Bunch
2022-10-11 13:18     ` Peter Stephenson

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=81965a4f-fff9-5a14-fac1-784ac46a6667@zentaur.org \
    --to=cdb_zsh@zentaur.org \
    --cc=zsh-workers@zsh.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 public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).