[Issue 14125] std.file has gotten out of hand

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Wed Feb 4 15:34:55 PST 2015


https://issues.dlang.org/show_bug.cgi?id=14125

Dicebot <public at dicebot.lv> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |public at dicebot.lv

--- Comment #2 from Dicebot <public at dicebot.lv> ---
Andrei, you may have been too quick to give a judgement without having a close
look what actually happens there.

All those @trusted functions exist there exact for the purpose of NOT marking
everything as @trusted but keeping actual function @safe. Those are used in
contexts where operation in general can't be verified to be @safe (and thus C
binding can't be marked @trusted itself) but it is verified in specific context
where it is called. Wrapping such call in trivial @trusted function allows to
keep everything else @safe and enjoy compiler verification.

I do immediately see that some of those posix functions could have been marked
as @trusted in extern(C) binding itself - and should probably be removed to
reduce visual noise and simplify maintenance.

However, there is nothing fundamentally broken with that code in context of
type system and language itself.

--


More information about the Digitalmars-d-bugs mailing list