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


Andrei Alexandrescu <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[email protected]


--- Comment #2 from Andrei Alexandrescu <[email protected]> 2010-08-19 
21:08:24 PDT ---
byChunk uses opApply. We need to transform it into a range; using opApply alone
severely limits the applicability of byChunk.

Here's a nice potential application of byChunk:

import std.stdio;
void main(string[] a) {
    enforce(a.length == 3);
    auto f1 = File(a[1]), f2 = File(a[2]);
    immutable bufsize = 1024 * 1024;
    return equal(f1.byChunk(bufsize), f2.byChunk(bufsize));
}

One other idea suggested by the above is to implement the algorithm found in
diff in std.algorithm. Then we can write a diff program in a dozen line of
code, using general components.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------

Reply via email to