`drop` not `opSlice` should be in the range api

Dukc ajieskola at gmail.com
Fri Jan 10 21:54:35 UTC 2025


On Friday, 10 January 2025 at 21:21:10 UTC, monkyyy wrote:
>
> users code should do the easiest thing that gets the task done
>
> lib code should be more ambitious and Im discussing range api 
> design of my lib code

Maybe you misunderstood. I wasn't writing that users don't need 
to care about performance. I meant that user's don't care about 
performance _most_ of the time, but they do care about it _some_ 
of the time. The convention is there to help users to distinguish 
their unoptimised and optimised code from each other.

Since you're writing about API design, it's very much a case of 
user code - that is, users of your library. It doesn't have 
anything to do with how you ambitiously you optimise your 
library, or what range API (if any) you use internally - that is 
entirely up to you to decide and independent of the user API 
design.

Note, I wrote this assuming you meant _user-facing_ range API. If 
you meant an internal API, I'll have to write another reply.


More information about the Digitalmars-d mailing list