protocol for using InputRanges

Dmitry Olshansky dmitry.olsh at gmail.com
Fri Mar 28 09:33:40 PDT 2014


28-Mar-2014 04:20, Walter Bright пишет:
> On 3/27/2014 2:56 PM, Andrei Alexandrescu wrote:
>> On 3/27/14, 2:24 PM, Walter Bright wrote:
>>> The range protocol is designed to work with streams.
>>
>> It's designed to work with containers.
>
> I know we talked about streams when we designed it.

If streams are like hot raw sockets then certainly it doesn't make 
sense. Ranges work nice when there are some "slots" down below, that is 
a buffer.

>>> It's a giant fail
>>> if they do not, or if you want to create a separate, non-range universe
>>> to deal with streams.
>>
>> It's not a giant fail, we just need to adjust the notion.
>
> Are you suggesting that ranges needn't support streams?

Yes they "don't support streams". They are an abstraction somewhere on 
top of buffering. This is where they fit nicely.


-- 
Dmitry Olshansky


More information about the Digitalmars-d mailing list