www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 13924] New: Deprecate std.random.uniformDistribution

https://issues.dlang.org/show_bug.cgi?id=13924

          Issue ID: 13924
           Summary: Deprecate std.random.uniformDistribution
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: Phobos
          Assignee: nobody puremagic.com
          Reporter: joseph.wakeling webdrake.net

std.random.uniformDistribution seems to me to be a function that doesn't do
what it claims to do (i.e. it doesn't provide a uniform probability
distribution in any meaningful sense that I can see), and also doesn't have any
obvious application that I can see.

The inability to generate an actual uniform distribution can be seen in the
small-n limit; if the intention really is (as it seems to be) to provide the
probability density function for a uniform distribution, then this could be
calculated deterministically.

The use of the name uniformDistribution also blocks a much more intuitive
(IMHO) use: to refer to an entity that generates variates from such a
distribution (cf. C++'s uniform_real_distribution and
uniform_int_distribution).

Apologies if I've misunderstood the purpose or application of this function,
but without clarification, I'm inclined to think it should be marked as
something not well-defined enough to hang around in Phobos.

--
Jan 01 2015