RFC: naming for FrontTransversal and Transversal ranges

Joel C. Salomon joelcsalomon at gmail.com
Thu Apr 30 15:34:17 PDT 2009


Andrei Alexandrescu wrote:
> A design that has one container type and several slice types that crawl
> it in various ways is very compelling, and I think it will be a huge
> selling point for D. It would be odd, not natural, to have arrays as a
> singularly distinct container that is in fact its own range. We get away
> with container == range for arrays partly because arrays are a simple
> structure, but that only blurs thinking and understanding of more
> complex containers. In fact, ranges do predict that any attempt to grow
> a range will cause topological issues in the owning container; that's
> why SList wisely (IMHO :o)) includes a template parameter that tells
> whether its topology is fixed or flexible.

It sounds like you’re suggesting that arrays become like all containers,
and that slices become a kind of range over the array.

Functions that now take arrays (which are possibly slices) and write to
them but don’t shrink or append to them, should therefore be rewritten
to take the range that covers the array.

B.T.W.:  What’s the syntax for a range that accesses the entire
container in index order?

—Joel Salomon



More information about the Digitalmars-d mailing list