Function types syntax

Neal Gafter neal at gafter.com
Tue Jan 26 08:21:35 PST 2010


On Tue, Jan 26, 2010 at 5:52 AM, Zdenek Tronicek <tronicek at fit.cvut.cz> wrote:
> As for the following syntax:
>
>> #(String: int) stringLength = #(String s: int length) label:{
>>   if (s == null) { length =-1; break label; }
>>   length = s.length();
>> };
>
> I do not understand where your enthusiasm comes from. I do not claim it
> cannot be used nor it is incorrect in some sense, but:
>
> 1) it uses a principle which is not common in Java (return value is in a
> variable),
> 2) it uses the break statement in a novel way,
> 3) it is not transparent (a consequence of 1) and 2)).

Actually, it is transparent.  This choice of syntax satisfies
Tennent's Correspondence Principle.


More information about the lambda-dev mailing list