[Issue 14125] @trusted nested helper functions in std.file

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Wed Feb 4 21:28:17 PST 2015


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

--- Comment #59 from David Nadlinger <code at klickverbot.at> ---
(In reply to Andrei Alexandrescu from comment #53)
> (In reply to David Nadlinger from comment #51)
> > (In reply to Andrei Alexandrescu from comment #42)
> > > Sigh, std.array has become another disaster area we need to clean.
> > 
> > What about just giving it a try?
> 
> Give what a try? The cleanup?

Yes. Or think about why e.g. marking a template function that iterates over a
range @trusted in its entirety would be almost always wrong, at least without
explicitly constraining the range regarding @safe-ty of its primitives.

To me, it seems rather obvious that @trusted blocks would be A Good Thing. To
you and/or Walter, it seems to be clear that they are The Root of All Evil. I
figure it would save us a lot of discussion if you had a look at real-world
code where their conceptual equivalent is useful right now.

(Just to be clear: Yes, nested functions that just pretend to be safe are ugly,
but immediately invoked delegates or real @trusted blocks aren't an option
right now. It's the concept that is important here.)

--


More information about the Digitalmars-d-bugs mailing list