On 9/3/11 10:11 PM, Steven Schveighoffer wrote:
On Sat, 03 Sep 2011 17:20:53 -0400, dsimcha <[email protected]> wrote:
== Quote from Andrei Alexandrescu ([email protected])'s
article
Hello,
There are a number of issues related to D's current handling of streams,
including the existence of the imperfect etc.stream and the
over-specialization of std.stdio.
Steve has worked on an extensive overhaul of std.stdio which would
obviate the need for etc.stream and would improve both the generality
and efficiency of std.stdio.
Please chime in with feedback; he's away from the Usenet but allowed me
to post this on his behalf. I uploaded the docs to
http://erdani.com/d/new-stdio/phobos-prerelease/std_stdio.html
Thanks,
Andrei
After a quick look, I have two concerns:
1. File is a class, not a struct. This precludes using reference
counting as the
current std.stdio.File does, meaning you have to close all your Files
manually. I
loved the reference counting semantics, especially the last few
releases since
most of the relevant compiler bugs have been fixed.
As long as a class can contain a File as a member, this argument makes
no sense to me. In other words, it's impossible to remove the GC from
the File destructor/refcounting system.
The meaning of the argument is that just because there is the
possibility of a File leaking, we shouldn't increase the likelihood of
such a leak.
Andrei