Challenge: write a reference counted slice that works as much as possible like a built-in slice

Andrei Alexandrescu SeeWebsiteForEmail at erdani.com
Thu Nov 11 23:03:00 UTC 2021


On 2021-11-08 20:04, deadalnix wrote:
> On Monday, 8 November 2021 at 22:40:03 UTC, Andrei Alexandrescu wrote:
>> On 2021-11-08 17:26, rikki cattermole wrote:
>>> a reference counted struct should never be const
>>
>> So then we're toast. If that's the case we're looking at the most 
>> important challenge to the D language right now.
> 
> Not necessarily, but this is in fact the same problem as the head 
> mutable problem.
> 
> If `const RCSlice!(const T)` can convert to `RCSlice!(const T)`, which 
> it should to have the same semantic as slice.
> 
> The reference counting problem goes away if you can mutate the head.

I very much wish that were the case. From what I remember working on the 
code, there were multiple other challenges.


More information about the Digitalmars-d mailing list