named arguments, string interpolation, please stop.

Dennis dkorpel at gmail.com
Thu Jan 11 21:06:08 UTC 2024


On Thursday, 11 January 2024 at 20:55:52 UTC, Timon Gehr wrote:
> On 1/11/24 20:33, Walter Bright wrote:
> Maybe you want to avoid implicit GC allocations in some part of 
> the code, but now you have to mark the entire function `@nogc` 
> to get the checking, and then you can no longer use exceptions 
> in that function.
>
> etc.

Considering the compiler doesn't use @nogc for anything that 
matters (unlike nothrow, which changes code generation), I wonder 
if we could degrade @nogc from a type attribute to a linting 
tool. It would still point out accidental array literals or 
closures, but not complain when calling a function that hasn't 
been proven to be @nogc.

It can still complain when calling a function that has been 
inferred @gc, and if you want to be GC free 100% certain, don't 
link it and the linker will complain about missing symbols.


More information about the Digitalmars-d mailing list