Jeremie Pelletier Wrote:

> He meant range structs as found in std.range and their array wrappers in 
> std.array.

Oh, okay.  Just groked src and looks like it is a D2 only thing.  Do you happen 
to know
what the derivation of the word "range" with respect to streams is?  I haven't 
come
across it before used in this context.

> A range is D's version of streams, so for example a simple reader might 
> look like:
> 
> void read(T)(in T range) if(isInputRange!T) {
>       while(!range.empty()) {
>               auto elem = range.front();
>               // process element
>               range.popFront();
>       }
> }
 
> I think you confuse ranges with slices. Ranges are simply an interface 
> for sequential or random data access. DOM trees and SAX callbacks are 
> different methods of parsing the xml, a range is a method of accessing 
> the data :)

Yes seems that way; my question apparently asked upon D1 knowledge only.

Re SAX, it easy enough to get James Clark's Expat 'C' parser happening with D.
That has an event-based API.  Perhaps all the std D library needs do is wrap 
this.
Whilst it's open source, dunno about the specific licensing issues though.

-- JJ

Reply via email to