Why I chose D over Ada and Eiffel

H. S. Teoh hsteoh at quickfur.ath.cx
Wed Aug 21 07:27:15 PDT 2013


On Wed, Aug 21, 2013 at 02:39:34PM +0200, Joseph Rushton Wakeling wrote:
> On 20/08/13 22:43, Andrei Alexandrescu wrote:
> >It's a common omission to equate D's ranges with pipes/filters. That misses the
> >range categorization, which is inspired from C++ iterators.
> >
> >A relatively accurate characterization of D ranges is a unification of C++
> >iterators with pipes/filters.
> 
> I'm not sure I quite follow this point.  The Clojure sequence API
> has all the stuff you'd expect from the range interface -- empty?,
> first (front), next (popFront), nnext (popFrontN), last (back),
> drop-last (popBack), ...
> 
> Is the point here that in Clojure these are all implemented as
> pipes/filters on top of singly-linked lists, whereas in D range
> interfaces are a "first-class" part of the language that is agnostic
> about the underlying data structures?

His point is that C++ iterators have input/forward/bidirectional
classifications, whereas the sequences in functional languages typically
don't. D's ranges therefore is a sort of integration of sequences in
functional languages with C++'s input/forward/bidirectional hierarchical
iteration scheme.


T

-- 
Amateurs built the Ark; professionals built the Titanic.


More information about the Digitalmars-d mailing list