JuliaLang/julia — pull request #8331 by rfourquet (2014-09-12 15:33:32+00:00)
Title: Make srand work similarly for global RNG and MersenneTwister instance

The docs pretended it did, but were lying.
Also, the first commit simplifies (see commit message) MersenneTwister in order to homogeneize how its constructor and its srand method work (the constructor now calls srand).

I would like to add another change (which is more breaking), but need feed-back: `MersenneTwister()` returns always a "similiar" instance by calling `MersenneTwister(0)` (I find this surprising), whereas `srand(r::MersenneTwister)` seeds `r` with the help of OS' provided entropy. This is not consistent and I'd prefer the second behavior for both methods (i.e. `MersenneTwister() = (m = MersenneTwister(0); srand(m); m)` or equivalent).
In fact I would like MersenneTwister having a unique constructor with unconstrained parameter which calls srand (boils down to adding string to the possible parameter types).