Discussion Thread: DIP 1035-- at system Variables--Final Review

Dennis dkorpel at gmail.com
Mon Feb 21 20:30:07 UTC 2022


On Monday, 21 February 2022 at 19:49:58 UTC, Paul Backus wrote:
> If there is no benefit to memory-safety from applying `scope`
> checking to data without indirections, then there is no
> justification for enabling such checks in all `@safe` code, 
> even if they may occasionally be "desirable" for other, 
> non-memory-safety-related reasons.

It is memory-safety related, it allows you to create custom 
pointer types. A pointer is just an integer under the hood, the 
idea of indirections and lifetimes is just a compile time idea 
around a `size_t` which indexes into memory. Why can't we do the 
same with a `ushort` which indexes into an array?


More information about the Digitalmars-d mailing list