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

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


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

--- Comment #62 from Andrei Alexandrescu <andrei at erdani.com> ---
(In reply to Dicebot from comment #60)
> (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.

I don't see how this is pushing your argument further. Make a technical point
and it'll be well appreciated.

> @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.

I see the good code in std.file has gone bonkers.

--


More information about the Digitalmars-d-bugs mailing list