DIP1000 scope inference

Salih Dincer salihdb at hotmail.com
Wed Oct 26 13:38:46 UTC 2022


On Wednesday, 26 October 2022 at 10:43:11 UTC, German Diago wrote:
> On Wednesday, 26 October 2022 at 08:03:37 UTC, Walter Bright 
> wrote:
>
>> A very good question. Clearly, having code work when it is 
>> @safe, but cause memory corruption when it is marked @trusted, 
>> is the wrong solution. This should never happen. I'm not sure 
>> what the solution should be here.
>
> Is not trusted code (note my little D experience so sorry if I 
> am asking something relatively stupid) unsafe? I mean, @safe is 
> safe, @trusted is ??, @system is you go your own.

@safe: it's like a seat belt. You can take your children, who 
come to see their uncle at the weekend, by car with their seat 
belts.

@trusted: it's like an uncle who didn't crash with his tractor. 
You can take your children around the field with their uncles by 
tractor.

We trust the uncle, but even if he did not have an accident, this 
2nd situation is not safe.

SDB at 79


More information about the Digitalmars-d mailing list