protocol for using InputRanges

Walter Bright newshound2 at digitalmars.com
Fri Mar 28 10:07:48 PDT 2014


On 3/28/2014 9:48 AM, Dmitry Olshansky wrote:
> 28-Mar-2014 13:55, Walter Bright пишет:
>> On 3/28/2014 1:32 AM, Johannes Pfau wrote:
>>> Ranges have equivalents in other languages:
>>> iterators in c++,
>>> IEnumerator in c#,
>>> Iterator in java
>>>
>>> all these languages have special stream types for raw data. I don't
>>> think it's bad if we also have streams/ranges separate in D.
>>
>>
>> Do you see a point to be able to, in an algorithm, seamlessly swap a
>> socket with a string?
>>
>
> Certainly NOT a socket. There is no escaping the fact that there are specifics
> to unbuffered direct streams.
> What you mention only makes sense with buffering either implicit or (I'd prefer)
> explicit.

Yes, it does require a one element buffer. But seriously, does a one character 
buffer from a socket have a measurable impact on reading from a network? I'm an 
efficiency wonk as much or more than anyone, and this appears to me to be a 
false savings.



More information about the Digitalmars-d mailing list