Function types syntax

Zdenek Tronicek tronicek at fit.cvut.cz
Tue Jan 26 23:17:21 PST 2010


Neal Gafter napsal(a):
> On Tue, Jan 26, 2010 at 5:17 AM, Peter Levart
> <peter.levart at marand.si>wrote:
>
>> For example:
>>
>> #(String: int) stringLength = #(String s: int length) label:{
>>  if (s == null) { length =-1; break label; }
>>  length = s.length();
>> };
>>
>
> Rather than introducing two different names and requiring separate
> statements for assignment and break, you could combine them into one
> construct:
>
> #(String: int) stringLength = #int(String s) length: {
>  if (s == null) break length =-1;
>  length = s.length();
> };
>

But then the return type is not present and although the compiler can
infer it quite easily, for a human being it means worse readability. And
Java is a language for human beings, isn't it?

Z.
-- 
Zdenek Tronicek
FIT CTU in Prague



More information about the lambda-dev mailing list