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

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


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

--- Comment #18 from Andrei Alexandrescu <andrei at erdani.com> ---
(In reply to David Nadlinger from comment #16)
> (In reply to Dicebot from comment #12)
> > It would help a lot if `() @trusted { foo(); }` lambdas could be 100%
> > inlined - then those could be used instead to prevent accidentla reusage of
> > wrapper in wrong context.
> 
> This. Solves the visual noise problem while keeping the good parts (only
> mark trusted what really needs to be).
> 
> In fact this has already been brought up in the "@trusted considered
> harmful" thread I started a couple of years (?) ago.

Clearly there has got to be reason and good judgment to this all. We can't
possibly decorate every other line of code with `() @trusted { ... }` and feel
good about it. `@trusted` means "verified by hand to be safe", and planting it
for arbitrary and arbitrarily small unsafe operations (such as pointer
additions) hinders proving, doesn't help it.

Any nice paint can be applied too thickly, and this is no exception.

--


More information about the Digitalmars-d-bugs mailing list