DIP1000: Walter's proposal to resolve ambiguity of ref-return-scope parameters
Dennis
dkorpel at gmail.com
Thu Nov 25 14:40:09 UTC 2021
On Thursday, 25 November 2021 at 14:16:21 UTC, zjh wrote:
> If attribute deduction is available, can the `attr` be omitted
> as much as possible?
Yes
> Looking at funcs, attrs all around, as a lover of clean code, I
> can't bear it.
You don't have to use the attributes, it's there for `@nogc`
`@safe` library code doing low-level memory management. Your
applications are free to ignore it most of the time.
Also, 'clean code' is subjective. The alternative to `scope`
parameters that you sometimes see in C libraries is a 'pointer
lifetime' section in a documentation comment, which is:
- inconsistent (varies per library)
- not verified for correctness (compiler doesn't understand it)
- more verbose than a single `scope` keyword
I don't consider that clean.
More information about the Digitalmars-d
mailing list