A syntax option (function types versus arrays)
Neal Gafter
neal at gafter.com
Tue Mar 2 07:43:39 PST 2010
On Tue, Mar 2, 2010 at 12:38 AM, Peter Levart <peter.levart at marand.si> wrote:
> Oops, this would make an ambiguous syntax:
>
> (->void) lambda = (->void);
>
> Or is this still unambiguous since type and expression appear in different contexts?
Yes, exactly. There are some interesting cases for the parser.
o A simple identifier X is ambiguous between a function type and a lambda.
o Something of the form {->X} is ambiguous between a function type
and a lambda whenever X is also.
So {->{->{->X}}} is ambiguous between a function type and a lambda.
This is the state of BGGA 0.5 and the BGGA compiler has no trouble
disambiguating during parsing.
Cheers,
Neal
More information about the lambda-dev
mailing list