www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 13107] New: std.range.table


          Issue ID: 13107
           Summary: std.range.table
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: Phobos
          Assignee: nobody puremagic.com
          Reporter: bearophile_hugs eml.cc

I suggest to add to Phobos a function like this:


It generates an infinite range of calls the function func. So this code:

table!uniform(0.0, 2.0)

Is similar to:

0.repeat.map!(_ => uniform(0.0, 2.0))

So to generate 100 random uniform values in [0.0, 1.0[:


It is related to this Mathematica function, but the syntax is different and
it's lazy and infinite:

Jul 12 2014