Re: Dithering about ranges

2009-05-22 Thread Andrei Alexandrescu
Steve Teale wrote: Andrei Alexandrescu Wrote: I don't quite understand this. Ranges are a very simple abstraction for iteration. They show how other iteration abstractions either were too unsafe and verbose (C++/STL) or too bare-bones (C# iterators, Java iterators, singly-linked lists used by f

Re: Dithering about ranges

2009-05-22 Thread Steve Teale
Andrei Alexandrescu Wrote: > I don't quite understand this. Ranges are a very simple abstraction for > iteration. They show how other iteration abstractions either were too > unsafe and verbose (C++/STL) or too bare-bones (C# iterators, Java > iterators, singly-linked lists used by functional l

Re: Dithering about ranges

2009-05-21 Thread Andrei Alexandrescu
Georg Wrede wrote: Not cosidering D or programming, the notion of a range implies a beginning and an end. Actually, not. Infinity is a primitive notion with ranges. A range that defines empty like this: enum bool empty = false; is detected as infinite and treated accordingly by certain othe

Dithering about ranges

2009-05-21 Thread Georg Wrede
Not cosidering D or programming, the notion of a range implies a beginning and an end. So, in a certain sense, ranges could be conceptualized as slices. All's well, and everything. But, things like input streams don't really support the notion of "range", or "slice". They don't even want to.