Herb Sutter briefly discusses D during interview
Sean Kelly
sean at invisibleduck.org
Wed Jun 8 09:20:26 PDT 2011
I don't read the declaration right to left or left to right so much as inside out, ie. (int[4])[3]
Sent from my iPhone
On Jun 8, 2011, at 8:38 AM, Timon Gehr <timon.gehr at gmx.ch> wrote:
> Jonathan M Davis wrote:
>> ...
>> No, people don't normally look at declarations such as
>>
>> int* a;
>>
>> as being right to left. But from the compiler's perspective, they are. The
>>
>> compiler doesn't look at the type of a as being an int pointer. It looks at it
>> as being a pointer to an int. The * comes first and then the int.
>> [snip.]
>
> It is more convenient for the compiler to read the declaration left to right to
> construct the type. (just like for people)
>
>
> Timon
More information about the Digitalmars-d
mailing list