Discussion Thread: DIP 1035-- at system Variables--Final Review
Paul Backus
snarwin at gmail.com
Tue Feb 22 01:43:26 UTC 2022
On Monday, 21 February 2022 at 22:56:30 UTC, Dennis wrote:
> - The compiler currently has a notion of a type that
> `hasPointers`. The extra complexity of adding a notion
> `hasSystemVariables` was daunting, but then I thought we could
> just make them the same. I think that would not only simplify
> the implementation, but also the feature in general. It makes
> it easy to draw a parallel to a pointer and a `@system size_t`.
The compiler needs at least two notions: `hasPointers` and
`hasUnsafeValues`. `hasUnsafeValues` is a superset of
`hasPointers`, and also includes aggregate types with `@system`
fields and [`bool`][1].
Since I assume you do not intend to expand `scope` checking to
`bool`, folding everything into a single concept will not be
possible.
[1]: https://issues.dlang.org/show_bug.cgi?id=20148
> - Some people asked for the feature (see links in the rationale
> section)
I've read those links. In one of them, the problem was solved
using existing DIP 1000 features. The other asks for "unique
references (and borrow) to plain ints". It is not clear to me
that `scope` checking for integers would solve either of these
problems. If you believe it would, then it should not be
difficult for you to write up an example demonstrating how.
More information about the Digitalmars-d
mailing list