On Saturday, 3 August 2013 at 13:35:56 UTC, Andre Artus wrote:
import std.stdio; import std.algorithm; void main() { auto values = [ 1, 2, 3, 4, 5 ]; writeln(values .map!(a => a * 10) .map!(a => a / 3) .filter!(a => !(a % 2))); }As stated this implies 3 separate traversals of the list (or array to be specific) which is what a naïve implementation would do.
In this example, no, as all involved ranges are evaluated lazily. (I see your general point, though.)
David
