On 5/2/25 2:44 PM, Python wrote:
> On Friday, 2 May 2025 at 14:33:57 UTC, Richard (Rikki) Andrew Cattermole
> wrote:
>> Have you tried filter?
>>
>> https://dlang.org/phobos/std_algorithm_iteration.html#.filter
>
> Thx. Anyway, what find returns aftrr first occurrence is unexpected.

Yes, understandably unexpected.

However, the choice of returning a range solves the other design problem of what to do when no item is found. 'find' communicates that case with an empty range.

Ali

  • D equivalent for... Python via Digitalmars-d-learn
    • Re: D equiv... Richard (Rikki) Andrew Cattermole via Digitalmars-d-learn
      • Re: D e... Python via Digitalmars-d-learn
        • Re:... Ali Çehreli via Digitalmars-d-learn
          • ... Jonathan M Davis via Digitalmars-d-learn
    • Re: D equiv... monkyyy via Digitalmars-d-learn

Reply via email to