function types syntax

Neal Gafter neal at gafter.com
Tue Jan 5 15:34:45 PST 2010


On Tue, Jan 5, 2010 at 3:28 PM, Rémi Forax <forax at univ-mlv.fr> wrote:
> Ok, my point was "you need to change the grammar" and it seems you agree
> about that.
> Else the contra-example:
> f( (Integer()) - 1);

That isn't ambiguous for the same reason

(Integer) - 1

isn't ambiguous between a cast to Integer versus subtracting 1 from
the value of a variable named Integer.  The grammar for a cast
expression is

CastExpression:
        ( ReferenceType ) UnaryExpressionNotPlusMinus

Cheers,
Neal


More information about the lambda-dev mailing list