std.Stream.InputStream convenience functions

bitwise via Digitalmars-d digitalmars-d at puremagic.com
Sun Sep 6 13:17:30 PDT 2015


On Sunday, 6 September 2015 at 20:05:20 UTC, BBasile wrote:
> On Sunday, 6 September 2015 at 18:52:34 UTC, bitwise wrote:
>> On Sunday, 6 September 2015 at 10:12:39 UTC, BBasile wrote:
>>> On Sunday, 6 September 2015 at 04:48:56 UTC, bitwise wrote:
>>>> On Sunday, 6 September 2015 at 03:42:20 UTC, BBasile wrote:
>>>>> [...]
>>>>
>>>> Same problem... StreamRange(...) assumes that all data in 
>>>> the stream is of the same type.
>>>>
>>>>   -Bit
>>>
>>> So Ranges are...
>>
>> So tell me how you expect to read a stream containing mixed 
>> data types...
>
> You should have got that's even not what i was talking about.
> Basic summary of the conversation:
>
> - you: hello what do you thing about my helpers functions?
> - others: nothing, we won't add this because streams are 
> deprecated. Maybe they'll come back one day if someone comes 
> with a kind of "rangified" stream solution.
> - you: how can I "rangify" a stream ?
> - me: hello, you can add the ranges primitives.
> - you: yes but it doesn't work for my particular case.
> - me: (sigh) I know, I was talking about how streams can be 
> rangified in a general way.
>
> I think that the misunderstanding happens after 'others' 
> intervention: 'other' did not suggested that your helper 
> functions can be made in the "Range" fashion.

The problem is, that you are concerned with who said what instead 
of addressing the problem.

The point is, streams can contain mixed data types. Any adopted 
solution should address this, and you haven't presented one.

I believe something like this could work:

http://dpaste.dzfl.pl/5f0ee693631a


More information about the Digitalmars-d mailing list