Proposal: Move 'split' into a separate class in System.Random

Thomas DuBuisson thomas.dubuisson at gmail.com
Sat Oct 9 17:38:02 EDT 2010


On Sat, Oct 9, 2010 at 1:59 PM, Antoine Latter <aslatter at gmail.com> wrote:
> What impact does this have on the 'Random' class? Has someone already
> brought this up? The patch on the ticket doesn't seem to touch it.
>
> It seems that it becomes less powerful. I'm not necessarily opposed,
> but I just wanted to make sure it was stated explicitly.

Correct, it is now less powerful but no default instance of Random
used split, so we're good there.  People have always had to explicitly
split then randomRs for decent behavior - this makes sense as hiding a
split inside randomRs isn't something a user can "recover" from where
as declining to split is a behavior the user can modify later.

> This seems that some structures which could have been randomly created
> lazily must now be more strict (and the instance must be re-written).
> I'm not sure that such instances exist, but they could be useful.

Could, yes, but perhaps those interfaces should be made like the
current Random instances that allows the end developer to decide if
the generator needs split.


Cheers,
Thomas


More information about the Libraries mailing list