Discussion Thread: DIP 1040--Copying, Moving, and Forwarding--Community Review Round 1

Max Haughton maxhaton at gmail.com
Sat Mar 13 00:29:54 UTC 2021


On Friday, 12 March 2021 at 23:52:00 UTC, Timon Gehr wrote:
> On 11.03.21 23:39, Walter Bright wrote:
>> On 3/11/2021 10:43 AM, Timon Gehr wrote:
>>> [...]
>> 
>> All the problems with const/immutable revolved around 
>> postblit. That's why this proposal has zero reliance on 
>> postblit.
>
> My concern was that similar mistakes can be repeated. You don't 
> ensure correctness just by avoiding the precise set of previous 
> mistakes; it's always possible to make new, slightly different 
> mistakes.
>
> The design of immutable and the design of postblit took place 
> independently of each other and they ended up being 
> incompatible. Why is the same thing not happening now? The DIP 
> seems to assume there is no such thing as immutable, just like 
> postblit did. A naive implementation of the DIP might therefore 
> implicitly cast away immutable, just like postblit did.

Is the specific issue here a move from an immutable struct 
breaking the immutable-contract silently?

Thank you for raising it even if not because this needs to be 
hashed out properly.


More information about the Digitalmars-d mailing list