[m-dev.] for review: extra modes for random.m

Ralph Becket rbeck at microsoft.com
Thu Mar 1 03:11:32 AEDT 2001


> From: Peter Schachte [mailto:schachte at cs.mu.OZ.AU]
> 
> I think Tom's right.  I can think of only two reasons for using a
> non-[m]di/[m]uo mode:  (1) because you for some reason want the same
> sequence of random numbers in two places in your code; and (2) because the
> incompleteness of the uniqueness system makes it too painful to live with
> the existing modes, so you'd rather lose the checking.  I don't think (1)
is
> a good reason for the change because I doubt it would come up very often,
> and it can be handled other ways.  The problem with reason (2) is that
when
> the uniqueness system is eventually fixed, you'll want to take away the
new
> modes to get back the checking, but this will break people's code.

(1) seems perfectly legitimate to me - there's nothing in that code that
*requires* mostly-uniqueness; those modes are partly there as a common case 
sanity check for the unwary programmer (not a bad thing, mind you).
(2) I've been hoping for yea since the Middle Ages, but these things 
take time.

The thing is, if you want protection of type (1) then you just need to
ensure that you use a mostly-unique mode for your random__supplies and
the mode checker will spot the sort of errors you're talking about.

Since we don't have (2) and sometime in the future there will be a library
version 2 in which all these wrinkles will be ironed out (we hope), I say
keep my change for now just on the grounds of utility.

> What you really need is a way to thread more than one pair of hidden
> arguments through a program ;-).

In my case that would lead to an unholy mess, alas.

- Ralph

p.s. Thanks to an e-mail problem, I checked in the change before I
got to see your response.  I hope it doesn't get backed out because
I need it to work.
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list