[m-users.] Random Number Generator

Volker Wysk post at volker-wysk.de
Wed Aug 2 18:48:32 AEST 2023


Hi

Am Mittwoch, dem 02.08.2023 um 13:08 +1000 schrieb Mark Brown:
> 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).

Using a mutable is what I've done. (See my post of yesterday). After Julien
made clear, that mutables are language feature and not something from a
library.

Cheers
Volker
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part
URL: <http://lists.mercurylang.org/archives/users/attachments/20230802/8632c655/attachment.sig>


More information about the users mailing list