Proposed Changes to the Range API for Phobos v3

Richard (Rikki) Andrew Cattermole richard at cattermole.co.nz
Fri May 17 14:42:06 UTC 2024


On 18/05/2024 2:28 AM, H. S. Teoh wrote:
> On Fri, May 17, 2024 at 03:33:26AM +1200, Richard (Rikki) Andrew Cattermole via Digitalmars-d wrote:
>> Two things I suggest we consider, given the write up:
>>
>> 1. Automatic boxing of slices into a struct, this was something I was
>> considering for signatures specifically for ranges.
> [...]
> 
> What's the purpose of this, other than to add friction to use built-in
> arrays as ranges?  What do we get in return for paying this price?

There would be no friction for users of ranges in PhobosV3 they would 
all be annotated to turn on the boxing automatically.

User made ones would need annotating however, that could be a bit of a pain.

It is a pain for user made ones already in v2, since you have to make 
sure you have the right import and don't use it in a way that UFCS 
cannot work.

So it solves a number of issues like conflicting definitions as 
described by J.M.D.

However he isn't keen on it, so as a proposal it'll probably end at my 
suggestion to consider it.


More information about the Digitalmars-d mailing list