Scott Meyers' DConf 2014 keynote "The Last Thing D Needs"

Jonathan M Davis via Digitalmars-d-announce digitalmars-d-announce at puremagic.com
Thu May 29 03:00:56 PDT 2014


On Thu, 29 May 2014 01:31:44 -0700
Ali Çehreli via Digitalmars-d-announce
<digitalmars-d-announce at puremagic.com> wrote:

> On 05/29/2014 12:59 AM, Jonathan M Davis via Digitalmars-d-announce
> wrote:
>
>  > So, unfortunately, I think that we're stuck.
>
> You make it sound like there is a problem. ;)
>
>  > I don't see much of an argument for why it makes any sense for
>  > static
> array
>  > dimensions be read from right-to-left in declarations.
>
> Language does not say anything about how people read declarations.
> Both static array dimensions and indexing are consistent currently in
> D.
>
> When declaring, it is always
>
>      Type[length]
>
> when indexing it is always
>
>      arr[index]

It's consistent until you have multiple dimensions. Then you end up with the
dimensions being listed right-to-left for static array declarations and
left-to-right in all other cases.

> Note that there is no such thing as a multi-dimensional array in C,
> C++, or D. Hence, there is no reading from any direction; there is a
> simple and consistent syntax.

??? C, C++, and D all have multi-dimensional arrays. e.g.

    int a[5][6]; // C/C++
    int[6][5] a; // D
    int** a;     // C/C++
    int[][] a;   // D
    int* a[5];   // C/C++
    int[5][] a;  // D

I don't see how you could argue that they don't have multi-dimensional arrays.

- Jonathan M Davis



More information about the Digitalmars-d-announce mailing list