http://d.puremagic.com/issues/show_bug.cgi?id=4851
Summary: Three suggestions for std.random Product: D Version: D2 Platform: All OS/Version: All Status: NEW Severity: enhancement Priority: P2 Component: Phobos AssignedTo: nob...@puremagic.com ReportedBy: bearophile_h...@eml.cc --- Comment #0 from bearophile_h...@eml.cc 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 = rndGen); Maybe a specified (with default) random generator is useful for randomSample() too: 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: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------