Challenge: Motivating examples for ...

Steven Schveighoffer schveiguy at gmail.com
Sun Apr 26 16:07:30 UTC 2020


On 4/25/20 2:52 PM, Paul Backus wrote:
> On Saturday, 25 April 2020 at 15:17:35 UTC, Steven Schveighoffer wrote:
>> I propose a function any which takes a range and returns true if any 
>> element matches the provided one. And another one all(val) which does 
>> the same if all are the value. This gives us maximum flexibility.
> 
> Looks like std.algorithm.any and std.algorithm.all can already do this.

Nice! The only thing I would say is I don't want to have a giant nest of 
subcalls for something like this, which can be done with one foreach 
loop. I'll have to look at the implementation.

-Steve


More information about the Digitalmars-d mailing list