Random sampling in Phobos

Joseph Rushton Wakeling joseph.wakeling at webdrake.net
Tue Apr 17 23:05:43 PDT 2012


On 18/04/12 07:50, Lars T. Kyllingstad wrote:
> Hmmm... I see now that randomSample() is defined without ref in Phobos as well.
> Would you care to check whether my suggestion fixes your problem? If so, it is a
> bug in Phobos that should be fixed.

There's an ongoing discussion on precisely this point:
http://d.puremagic.com/issues/show_bug.cgi?id=7067

As you can see from there, it's non-trivial to just pass the RNG by ref.  I'll 
hold off on a decision on that before I tweak my own code one way or another.

There is also an additional RNG-related bug,
http://d.puremagic.com/issues/show_bug.cgi?id=7936

... which Jerro has nicely provided a fix for:
https://github.com/D-Programming-Language/phobos/pull/542


More information about the Digitalmars-d mailing list