named arguments, string interpolation, please stop.

Richard (Rikki) Andrew Cattermole richard at cattermole.co.nz
Thu Jan 11 21:43:59 UTC 2024


On 12/01/2024 10:06 AM, Dennis wrote:
> 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.

@localnogc is what I want.

Check everything but function calls.

Easy to implement, and helps make sure if you care that a closure is 
stack allocated, it won't heap allocate.


More information about the Digitalmars-d mailing list