yet another function types syntax variation

Peter Levart peter.levart at marand.si
Tue Feb 9 01:45:33 PST 2010


This time a variation of the proposed (prefix) notation which goes like:

FunctionType:
    '#' ReturnType  '(' ParameterTypes_opt ')' Throws_opt


What would happen if the '#' and 'ReturnType' changed places?

FunctionType:
    ReturnType '#' '(' ParameterTypes_opt ')' Throws_opt


Nested return types might look better:

##int(byte[],int,int)(throws IOException)(File)(throws IOException)

vs.

int #(byte[],int,int) throws IOException #(File) throws IOException


Here the '#' is in the place where a method name is expected, so everything on the left of '#' is a return type. One might prefer puting an optional space between ReturnType and '#' to make it visualy lighter. Using '|' instead of ',' between throws types eliminates the need for a second pair of parens.

What do you think?

Regards, Peter


More information about the lambda-dev mailing list