[Issue 8247] Inconsistent behaviour of randomSample depending on whether a random number generator is specified

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Jun 14 15:25:21 PDT 2012


http://d.puremagic.com/issues/show_bug.cgi?id=8247


Jonathan M Davis <jmdavisProg at gmx.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jmdavisProg at gmx.com


--- Comment #3 from Jonathan M Davis <jmdavisProg at gmx.com> 2012-06-14 15:27:33 PDT ---
If you want randomSample to be consistent as to which you get, it needs to be
made to handle both reference and value type random number generating ranges
identically, since they could be either. At present, all of those in std.random
are value types, which is actually a problem in general. They really should
reference types. But regardless of which they are, there's nothing stopping
someone from implementing either a value type or reference type range which is
a random number generator, in which case you'll get inconsistent behavior if
randomSample doesn't code for using both by using save where appropriate.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list