[m-users.] Random Number Generator

Mark Brown mark at mercurylang.org
Wed Aug 2 13:08:03 AEST 2023


On Wed, Aug 2, 2023 at 2:55 AM Volker Wysk <post at volker-wysk.de> wrote:
>
> Hi, Mark
>
> Am Dienstag, dem 01.08.2023 um 22:08 +1000 schrieb Mark Brown:
> > > Yes, that's what I was wondering. And if it was possible to get rid of
> > > that
> > > extra argument.
> >
> > You can use one of the submodules directly.
>
> Unless if you want to attach the RNG to the IO state.

That's correct, we don't provide a global RNG of any sort. You can use
get_globals and set_globals in the I/O module to implement this
interface in a straightforward way, but we don't recommend this as it
is a poor design. That is why those predicates are obsolete, and the
user is advised to use a mutable instead (which is what I was
suggesting above).

Mark


More information about the users mailing list