Difference between revisions of "Talk:DIP69"

From D Wiki
Jump to: navigation, search
(One example bug)
 
(Removed example because it's probably Issue 9685)
 
Line 1: Line 1:
See one bug that DIP69 (or similar proposals) must help remove from D code:
 
http://forum.dlang.org/post/zpuriaktffctmnljuprq@forum.dlang.org
 
  
    import std.range, std.algorithm, std.stdio;
 
   
 
    void foo(float[] data, float[] xs, float[] ys)
 
    {
 
        auto indices = iota(0, data.length, ys.length)
 
            .map!(xBase =>
 
                    iota(xBase, xBase + ys.length - 1)
 
                    .map!(y =>
 
                        only(y, y+ys.length, y+ys.length+1, y+1))
 
                    .joiner())
 
            .joiner();
 
        writeln(indices);
 
    }
 
   
 
    void main()
 
    {
 
        foo([1,2,3,4,5,6,7,8],
 
                [0.1,0.2], [10,20,30,40]);
 
    }
 

Latest revision as of 17:33, 16 February 2015