Simplification of @trusted

Bruce Carneal bcarneal at gmail.com
Wed Jun 16 22:02:18 UTC 2021


On Wednesday, 16 June 2021 at 21:47:55 UTC, jmh530 wrote:
> On Wednesday, 16 June 2021 at 21:22:32 UTC, Walter Bright wrote:
>> [snip]
>>> `@trusted` *should* probably not even be available for 
>>> functions (of course it is not a desirable breaking change to 
>>> disallow that now, though).
>>
>> The idea is to encourage programmers to think about organizing 
>> code so that there are clear separations between safe and 
>> system code. Interleaving the two on a line-by-line basis 
>> defeats the purpose.
>
> This is a better argument against @trusted blocks within @safe 
> blocks than it is against @system blocks within @trusted code.

I'd love to see those gone as well but it could be hard to get 
there from here.

It's easier to validate simply nested rather than finely 
interwoven dependencies.

I hope we can start reversing course rather than moving further 
down the "convenience over practical safety" path.



More information about the Digitalmars-d mailing list