Scott Meyers' DConf 2014 keynote "The Last Thing D Needs"
Simen Kjærås via Digitalmars-d-announce
digitalmars-d-announce at puremagic.com
Thu May 29 07:09:29 PDT 2014
On 2014-05-29 03:29, Jonathan M Davis via Digitalmars-d-announce wrote:
> 1. The order of the dimensions of multi-dimensional static arrays is backwards
> in comparison to what most everyone expects.
>
> int[4][5][6] foo;
>
> is the same as
>
> int foo[6][5][4];
>
> and has the same dimensions as
>
> auto bar = new int[][][](6, 5, 4);
IMO, it's the dynamic array creation syntax that's weird here. The
static array syntax is sensible, easy to explain, and consistent with
reading the type left to right. I've never used the syntax for creating
a multidimensional dynamic array, so I was frankly surprised to see it
worked that way.
--
Simen
More information about the Digitalmars-d-announce
mailing list