std.xml should just go

Walter Bright newshound2 at digitalmars.com
Fri Feb 4 09:55:10 PST 2011


BLS wrote:
> I got more and more the feeling that the D2 monster was made just for 
> ranges.

The only range support that is actually in the language is in foreach. That can 
be ignored if you prefer.

Unix's core structure is that everything is a file. Operations are strung 
together as operations on files, the output of each "filter" is fed as a file 
into the next one. The huge success is that so many operations are implementable 
as filters, and that filters can be plugged together in any order.

There have been many attempts to duplicate this success in programming 
languages, called "component" programming.

Lisp is, of course, a very early example. It accomplished this by "everything is 
a list", and so diverse operations on lists could all be componentized snapped 
together.

Microsoft COM is another example, built on top of OOP.

C++'s hat in that ring is iterators, and to some extent it was successful. I 
think C++ would be dead now if not for iterators.

I'm as convinced as I can be without a decade of experience behind it, that 
ranges are the new paradigm for component programming. The more Phobos APIs are 
reworked to use ranges, the more componentized things get. I don't think we've 
quite reached the tipping point yet, but we're close.

Although I said earlier that the only explicit range support in D2 is in 
foreach, a lot of the enhancements and adjustments to D2 were to better support 
ranges.


More information about the Digitalmars-d mailing list