Herb Sutter briefly discusses D during interview
Timon Gehr
timon.gehr at gmx.ch
Wed Jun 8 09:33:19 PDT 2011
Jonathan M Davis wrote:
> Sight correction (I was in too much of a hurry when I typed that). The parsing
> is done left-to-right just like the lexing/scanning is (it has to be).
> However, the processing of the AST is effectively done outward from the
> variable name. That is, the semantic analysis of the type is done outward from
> the variable name and thus left-to-right. So, as far as the compiler getting
> any meaning out of the type and figuring out what to do with it goes, it reads
> right-to-left, _not_ left-to-right. And if you try and read it like a compiler
> does - e.g. pointer to pointer to int, not int pointer pointer - then you'll
> end up reading it right-to-left too.
>
> - Jonathan M Davis
Seems like we are agreeing perfectly. As to pointer to pointer to int vs int
pointer pointer, the only difference is:
pointer to pointer to int
<=>
pointer -> pointer -> int
int pointer pointer
<=>
int <- pointer <- pointer
Both describe the same AST. Therefore both describe the way the compiler handles it.
I prefer int pointer pointer for the same reason the compiler prefers it.
Timon
More information about the Digitalmars-d
mailing list