On Friday, 23 January 2015 at 13:55:04 UTC, aldanor wrote:
> auto lines = stdin.byLine.map!(line => line.length);
> writefln("Average line length: %.4f.", 1.0 * lines.sum /
> lines.array.length);
This won't work; `sum` already consumes the range, so there will
be nothing left to compute the length from.