A syntax option (function types versus arrays)

Peter Levart peter.levart at marand.si
Mon Mar 1 23:49:54 PST 2010


I think we don't need statement lambdas if we allow expression to be preceeded by statements (like in block expression of CfJ0.6b):

Lambda:
  '(' FormalParameters_opt '->' Statements_opt Expression ')'

for void lambdas "void" keyword could be defined as expression of type void:

(->void) lambda = (-> System.out.println("Hello!"); void);


Regarding arrays of function types, this syntax:

FunctionType:
  '(' ParameterTypes_opt Throws_opt '->' ReturnType ')'

is perfectly combinable with array type syntax.

Peter

On Tuesday 02 March 2010 03:18:30 Reinier Zwitserloot wrote:
> In regards to:
> 
> (String x -> 3)
> 
> What is this going to look like when the body of the closure is not a single
> expression but a block?
> 
> --Reinier Zwitserloot
> 


More information about the lambda-dev mailing list