Feedback Thread: DIP 1035-- at system Variables--Final Review
Dennis
dkorpel at gmail.com
Fri Mar 4 09:57:03 UTC 2022
On Monday, 21 February 2022 at 20:02:04 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.
I'll summarize my response from the Discussion Thread here. The
idea is not to add scope checking to plain integers for
non-memory-safety-related reasons, but to be able to create
custom types that represent an indirection backed by an integer
field. A pointer is also just an integer under the hood.
But indeed, the DIP does not demonstrate what kind of `@trusted`
code this enables, and there are cases where you might want
unsafe values without scope checking (such as `bool`), so maybe
it shouldn't be an effect of `@system` members.
More information about the Digitalmars-d
mailing list