ideas about ranges

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Fri May 22 18:50:03 PDT 2009


Steven Schveighoffer wrote:
> On Fri, 22 May 2009 21:22:55 -0400, Andrei Alexandrescu 
> <SeeWebsiteForEmail at erdani.org> wrote:
>> 1. Any range should be seamlessly and efficiently used as an input range.
> 
> This is the assumption I am challenging.  I don't think you need this 
> assumptions for ranges to work.  You can always bolt input range 
> functionality on top of a stream range if you want to treat a stream as 
> an input range for some reason.

I believe there is indeed a terminology problem. To me, "input range" == 
"stream" == "socket" == "bridge that is sinking under your feet as you 
walk it". So to me there exists no "stream range". That to me is an 
"input range".

> But if foreach doesn't utilize the 
> popNext api, then streams require an unnecessary layer on top, just to 
> use foreach with them.

We can arrange that foreach uses popNext, but it must be worth it.

Andrei



More information about the Digitalmars-d mailing list