Beta 2.082.0

Jesse Phillips Jesse.K.Phillips+D at gmail.com
Thu Oct 18 01:22:11 UTC 2018


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.


More information about the Digitalmars-d-announce mailing list