Proposed Changes to the Range API for Phobos v3

Ogi ogion.art at gmail.com
Fri May 17 13:22:48 UTC 2024


On Thursday, 16 May 2024 at 14:56:55 UTC, Jonathan M Davis wrote:
> Alternatively, we could add an enum of some kind to the new 
> range API to make it different. It would be kind of ugly, but 
> it would allow us to keep all of the current function names

Actually, this option worth exploring.

We can see now that implicit interfaces have downsides. When the 
interface changes, we are forced to jump through hoops to avoid 
problems. And what would will do if at some point in future we 
want to change API again? Come up with another set of names? 
Versioning would solve this once and for all.

If you think that enum is ugly, we can use an UDA instead. This 
way, ranges that use the new API will be instantly recognizable.







More information about the Digitalmars-d mailing list