On Monday, 30 December 2019 at 23:15:48 UTC, JN wrote:
I also had to ask because I couldn't find it. In other languages it's named "index()", "indexOf()" or "find()". D is the only language I know which uses the "countUntil" scheme. And even so it's not obvious from the name if it's the index of the element or number of preceding elements.

The main difference to other languages is that countUntil works an arbitrary ForwardRanges which might not offer random access, hence index would be misleading for them.

But improvements to the documentation could probably help to alleviate this confusion.

Reply via email to