Stream Proposal

Jonathan M Davis jmdavisProg at gmx.com
Fri Mar 11 19:50:31 PST 2011


On Friday, March 11, 2011 19:40:47 dsimcha wrote:
> On 3/11/2011 10:14 PM, Jonathan M Davis wrote:
> > On Friday, March 11, 2011 18:29:42 dsimcha wrote:
> >> 3.  std.stdio.File should be moved to the new stream module but publicly
> >> imported by std.stdio.  It should also grow some primitives that make it
> >> into an input range of characters.  These can be implemented with
> >> buffering under the hood for efficiency.
> > 
> > ??? Why? File is not a stream. It's a separate thing. I see no reason to
> > combine it with streams. I don't think that the separation between
> > std.stdio and std.stream as it stands is a problem. The problem is the
> > design of std.stream.
> > 
> > - Jonathan M Davis
> 
> Isn't file I/O a pretty important use case for streams, i.e. the main one?

Yes. You should be able to read a file as a stream. But that doesn't mean that 
std.stdio.File needs to be in std.stream or that it needs to use streams. The 
way that File is currently used to read files shouldn't change. The streaming 
stuff should be in addition to that.

- Jonathan M Davis


More information about the Digitalmars-d mailing list