Proposed Changes to the Range API for Phobos v3

H. S. Teoh hsteoh at qfbox.info
Fri May 17 14:30:47 UTC 2024


On Fri, May 17, 2024 at 01:22:48PM +0000, Ogi via Digitalmars-d wrote:
> 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.
[...]

+1, I like the UDA idea.  It will be much less effort to migrate to the
new range API to slap a UDA on, than to rename every range method.


T

-- 
Bare foot: (n.) A device for locating thumb tacks on the floor.


More information about the Digitalmars-d mailing list