On Wednesday, 17 October 2018 at 16:14:14 UTC, Neia Neutuladh wrote:
On Wednesday, 17 October 2018 at 14:02:20 UTC, Jesse Phillips wrote:
Wait, why does each get a special bailout? Doesn't until full that role?

`until` is lazy. We could have `doUntil` instead, which would be eager and would return a boolean indicating whether to continue. We could all write `someRange.until!condition.each!func`. That's going to be clearer sometimes and less clear other times. So now we have options.

    auto arr = [10, 20, 30];
    arr.until!(x=>n==20).each!(n => arr ~= n);

Ok, I can see why that doesn't work.

Reply via email to