Dithering about ranges

Georg Wrede georg.wrede at iki.fi
Thu May 21 16:59:29 PDT 2009


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.

Sure, one could "coerce" or "forge" an input range to pretend some 
manner of them, but that would be awkward at best, and laborios in practice.


Does that mean that I'm against ranges? No. But there might be the 
possibility that ranges are not a panacea. Just as Structured 
Programming wasn't (look at Walter's gotos all over the place), OOP 
wasn't, Functional Programming wasn't, or that metaprogramming doesn't 
tell us whether God exists. Ranges solve some gargantuan problems in 
Modern Programming, but I don't expect them to usurp a dozen of other 
paradigms.

Could it be that the optimum would be to have /both/ ranges and, ehhh, 
pointing notions?

Today, no sane programmer (outside of C or outside of Java) would make 
his application /entirely/ ranges or /entirely/ classes.



More information about the Digitalmars-d mailing list