proposed syntax change

Jarrett Billingsley jarrett.billingsley at gmail.com
Thu Aug 6 15:10:27 PDT 2009


On Thu, Aug 6, 2009 at 6:02 PM, Robert Jacques<sandford at jhu.edu> wrote:

>> int a = 5 / 2; // compiler knows to use integer division
>
> No, it doesn't. (i.e. Welcome to the limitations of a context-free grammar)
> The right hand of the expression has to be evaluated before the left, or
> otherwise function overloads, etc, don't work, so there's no way for the
> compiler to know the type of the expected result when 5/2 is evaluated.

Uh, no.  This has literally nothing to do with the grammar.  What
happens in this line would be determined in the semantic phase, not
parsing.



More information about the Digitalmars-d mailing list