[m-users.] The new random module(s)

Mark Brown mark at mercurylang.org
Thu Sep 5 15:17:46 AEST 2019


Hi Julian,

On Thu, Sep 5, 2019 at 2:57 PM Julian Fondren <jfondren at minimaltype.com> wrote:
>
> On 2019-09-04 23:40, Julien Fischer wrote:
> > Hi Julian,
> >
> > On Wed, 4 Sep 2019, Julian Fondren wrote:
> >
> >> One benefit to the new code is that you don't need to use the FFI (or
> >> read from a random device) just to get a random seed.
> >
> > The intention here is that the stdlib will provide an interface to
> > a random device on the system (/dev/random etc, whatever is appropriate
> > for the underlying target language / platform).
>
> oh... yeah. I assumed this was already happening with the new random
> since it had a 'default seed', but that's actually a constant.

Right. I should perhaps clarify the documentation in that regard.

Since you are using this module, can I ask your opinion on how long to
keep the old implementation around? Removing it will force people to
update their code sooner, but will also free up the namespace so we
can add a new version of random.permutation/4.

Or we could add them now, both to the random module, if the names are
changed to permute_array and permute_list.

(Initially I put the new stuff all in a new module, which avoids the
namespace clashes, but we do actually want the module to be named
"random" in the long run.)

Mark


More information about the users mailing list