[Issue 5441] New: std.random.rndGen always returns Random.

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Jan 10 09:45:28 PST 2011


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

           Summary: std.random.rndGen always returns Random.
           Product: D
           Version: unspecified
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: Phobos
        AssignedTo: andrei at metalanguage.com
        ReportedBy: repeatedly at gmail.com


--- Comment #0 from Masahiro Nakagawa <repeatedly at gmail.com> 2011-01-10 09:43:40 PST ---
Created an attachment (id=867)
Patch for this suggestion

rndGen always returns Random(usually MT) object. This is often useful, but
randomShuffle cant't take other random generators.

I think following signature is better.

    ref RandomGen rndGen(RandomGen = Random)()

But this change forces us to write parenthesis function call.

    rndGen;    // Compilation error
    rndGen();  // OK, return Random object.

For me, this is no problem. However I don't know the writing style of other
people.

-- 
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