[mercury-users] a typeclassful random.m

doug.auclair at logicaltypes.com doug.auclair at logicaltypes.com
Sat Feb 24 19:14:22 AEDT 2007


Also, since everyone who is going to be using this protocol with
the tausworthe3 implementation is going to be writing the following
anyway:

some_jrnd(Taus, !IO) :-
	some [!DRNG] (trandom1.open(device_seed("/dev/urandom"), !:DRNG, !IO),
	              random_int(A, !DRNG, !IO),
		      random_int(B, !DRNG, !IO),
		      random_int(C, !DRNG, !IO),
		      trandom1.close(!.DRNG, !IO),
                       trandom1.seed(tausworthe3_seed(A, B, C), Taus)).

... perhaps that can be added to the protocol as a helper pred?

Sincerely,
Doug Auclair

--------------------------------------------------------------------------
mercury-users mailing list
Post messages to:       mercury-users at csse.unimelb.edu.au
Administrative Queries: owner-mercury-users at csse.unimelb.edu.au
Subscriptions:          mercury-users-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the users mailing list