protocol for using InputRanges

Johannes Pfau nospam at example.com
Fri Mar 28 01:32:28 PDT 2014


Am Thu, 27 Mar 2014 17:20:25 -0700
schrieb Walter Bright <newshound2 at digitalmars.com>:

> 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.
> 
> 
> >> 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?
> 
> Note also that I suggested a way Steven could create an adapter with
> the behavior he desired, yet still adhere to protocol. No notion
> adjustments required.

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. 


More information about the Digitalmars-d mailing list