Summary: Three suggestions for std.random
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: Phobos

--- Comment #0 from 2010-09-10 15:06:37 PDT ---
It's handy to set a default random generator for randomShuffle() too, like:
void randomShuffle(Range, RandomGen = Random)(Range r, ref RandomGen gen =

Maybe a specified (with default) random generator is useful for randomSample()
RandomSample!(R, RandomGen) randomSample(R, RandomGen = Random)(R r, size_t n,
ref RandomGen gen = rndGen, size_t total);

Very often I need to pick a single random item from a collection. In Python for
this there is the random.choice() function. I suggest to add a simple similar
function to std.random too, that is semantically similar to:
randomCover(a, rndGen).front

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to