www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 12842] New: More support for ranges of ranges


          Issue ID: 12842
           Summary: More support for ranges of ranges
           Product: D
           Version: unspecified
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: Phobos
          Assignee: nobody puremagic.com
          Reporter: john.loughran.colvin gmail.com

std.range and std.algorithm often have support for an arbitrary number of
ranges passed as seperate parameters, but very few offer range-of-range

Usage example:

auto a = [1,2,3,4];
auto b = [5,6,7,8,9];

//a rectangular matrix in flat form
auto cp = cartesianProduct(a, b).map!"a[0] * b[0]"();

//expand to RoR, take the transform and return to flat
auto cpT = cp.chunks(a.length).roundRobin().joiner();

Currently that doesn't work as roundRobin doesn't know how to handle ranges of

Jun 02 2014