and, finally, this works using the taskPool.map, as in the std.parallelism example. So, the trick appears to be that the call to chomp is needed.

        auto lineRange = File(fn).byLineCopy();
        auto chomped = std.algorithm.map!"a.chomp"(lineRange);
        auto nums = taskPool.map!(to!double)(chomped);
        auto logs = taskPool.map!log10(nums);

        double sum = 0;
        foreach(elem; logs)
        {
                sum += elem;
        }
        writeln("sum=",sum);

Reply via email to