@trust is an encapsulation method, not an escape

Walter Bright via Digitalmars-d digitalmars-d at puremagic.com
Fri Feb 6 13:56:12 PST 2015


On 2/6/2015 11:29 AM, Zach the Mystic wrote:
> My attitude is not based on evidence. It's based on just thinking about the
> problem:
>
> http://forum.dlang.org/post/eeglnychgudcffpjcdvy@forum.dlang.org
>
> I really can't answer this question.

You asked:

"Why not force the programmer to tag precisely those portions of his code
which cause him to tag his function @trusted to begin with?"

That question has been asked and answered repeatedly. The answer is that 
@trusted is not only to TAG unsafe code, but must provide a SAFE INTERFACE to it.

    @trusted {
       ... unsafe code ...
    }

provides no indication of what the interface to the unsafe code is. Addressing 
only the TAG aspect is insufficient.


More information about the Digitalmars-d mailing list