On Sunday, September 25, 2016 00:36:58 pineapple via Digitalmars-d wrote: > On Thursday, 22 September 2016 at 12:51:59 UTC, Andrei > > Alexandrescu wrote: > > On 9/22/16 6:38 AM, pineapple wrote: > >> The greatest offender I've found is how in phobos, arrays do > >> not behave > >> as ranges without importing the module defining their range > >> operations. > > > > Would make sense to move those few primitives to object.d. I've > > been thinking of that a long time ago but back then there was a > > vague stance that object.d shouldn't contain templates. Since > > then that has changed. -- Andrei > > I strongly disagree - I have been working a library that does not > treat arrays as ranges, but as a type that a range can be created > from. This design difference has proven rather elegant and solves > a lot of problems I've run into using phobos. I think the > (unlikely but ideal) solution is for phobos to adopt a similar > approach, and not to warp the core language to accommodate > phobos' strange design decisions. > > Also, auto-decoding is a plague and it need not spread any > farther than it already has done. > > https://github.com/pineapplemachine/mach.d/blob/master/readme.md#arrays-aren > t-ranges
Considering that a random access range is essentially an abstraction for a dynamic array and that ranges were designed with that in mind, I don't know how you can argue that dynamic arrays shouldn't be treated as ranges. The auto-decoding is certainly an issue, but that only affects ranges of char and wchar. The vast majority of dynamic arrays are perfectly normal ranges. - Jonathan M Davis
