Range golf challenge: apply predicate to a subrange, returning the original range modified.

FeepingCreature feepingcreature at gmail.com
Fri Oct 7 15:18:08 UTC 2022


On Friday, 7 October 2022 at 14:16:19 UTC, Andrey Zherikov wrote:
> On Friday, 7 October 2022 at 14:00:57 UTC, FeepingCreature 
> wrote:
>> Task: Given a range `range`, return a new range that consists 
>> of the elements of `range`, except modified with the `modify` 
>> predicate at all elements that are part of the subrange 
>> selected by `.select`.
>
> May be I misunderstood but why doesn't `.select.map` work here?

`range.select` returns a subrange of `range`. What's desired is 
"`range`, but with the *subrange only* mapped to `modify`."


More information about the Digitalmars-d mailing list