Control Invocation Syntax++
Neal Gafter
neal at gafter.com
Tue Dec 22 22:26:28 PST 2009
On Tue, Dec 22, 2009 at 7:54 AM, Peter Levart <peter.levart at marand.si> wrote:
> I'm sure you meant that but it was to verbose to put into the spec. document.
I can easily believe you are correct, but I haven't reviewed your
comment in detail.
> Ok, now to something different. I was thinking about an alternative syntax.
>
> First, the syntax of parenthesized expression migh allow the expression in it to be optional:
>
> ParExpression:
> ( [BlockStatements] Expression )
> ( BlockStatements )
Yes, that is different. Why would you make that suggestion?
> Next, instead of "ControlInvocationStatement" I would propose "ControlInvocation" expression (being one of possible "Primary" expressions):
>
> ControlInvocation:
> [for] MethodName ( FormalParameters [: ArgumentList] ) ParExpression
> [for] Primary [. NonWildTypeArguments] Identifier ( FormalParameters [: ArgumentList] ) ParExpression
> [for] super [. NonWildTypeArguments] Identifier ( FormalParameters [: ArgumentList] ) ParExpression
> [for] ClassName . super [. NonWildTypeArguments] Identifier ( FormalParameters [: ArgumentList] ) ParExpression
> [for] TypeName [. NonWildTypeArguments] Identifier ( FormalParameters [: ArgumentList] ) ParExpression
> [for] MethodName ( [ArgumentList] ) ParExpression
> [for] Primary [. NonWildTypeArguments] Identifier ( [ArgumentList] ) ParExpression
> [for] super [. NonWildTypeArguments] Identifier ( [ArgumentList] ) ParExpression
> [for] ClassName . super [. NonWildTypeArguments] Identifier ( [ArgumentList] ) ParExpression
> [for] TypeName [. NonWildTypeArguments] Identifier ( [ArgumentList] ) ParExpression
These are all ambiguous with the idea of being able to invoke an
expression of function type without the ".invoke".
Cheers,
Neal
More information about the closures-dev
mailing list