Another new io library

Steven Schveighoffer via Digitalmars-d digitalmars-d at puremagic.com
Thu Feb 18 07:44:00 PST 2016


On 2/17/16 5:54 AM, John Colvin wrote:
> On Wednesday, 17 February 2016 at 07:15:01 UTC, Steven Schveighoffer wrote:
>> On 2/17/16 1:58 AM, Rikki Cattermole wrote:
>>
>>> A few things:
>>> https://github.com/schveiguy/iopipe/blob/master/source/iopipe/traits.d#L126
>>>
>>> why isn't that used more especially with e.g. window?
>>> After all, window seems like a very well used word...
>>
>> Not sure what you mean.
>>
>>> I don't like that a stream isn't inherently an input range.
>>> This seems to me like a good place to use this abstraction by default.
>>
>> What is front for an input stream? A byte? A character? A word? A line?
>
> Why not just say it's a ubyte and then compose with ranges from there?

If I provide a range by element (it may not be ubyte), then that's 
likely not the most useful range to have.

For example, the byLine iopipe gives you one more line of data each time 
you call extend. But the data in the window is not necessarily one line, 
and the element type is char, wchar, or dchar. None of those I would 
this is what someone would expect or want.

This is why I think it's better to have the user specifically tell me 
"this is how I want to range-ify this stream" rather than assume.

-Steve


More information about the Digitalmars-d mailing list