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

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


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

--- Comment #60 from Dicebot <public at dicebot.lv> ---
(In reply to Andrei Alexandrescu from comment #58)
> (In reply to Dicebot from comment #57)
> > You shouldn't consider those wrapper really @trusted - they have _never_
> > supposed to be ones. It is simply a workaround for bunch of language
> > limitations. I'd love to have something better to address the issue - not
> > regress to worse solution because workaround was not good enough.
> 
> We do have something better: @trusted functions that offer safe interfaces
> with unsafe implementations. This is the right thing to do. This whole
> fine-granularity of trusted mini-functions adding no safety is a gross abuse
> of a good notion.

"those aren't the droids you're looking for" approach does not work on me,
sorry.

@trusted functions longer than few lines are inherently unmaintainable unless
implementation is supposed to be read-only (like with bindings). Saying "no,
you don't really have the problem" doesn't make it go away. Especially when I
have already tried approach you suggest and experienced how it fails in
practice.

--


More information about the Digitalmars-d-bugs mailing list