Syntax...

Neal Gafter neal at gafter.com
Sat Nov 21 09:28:00 PST 2009


On Sat, Nov 21, 2009 at 9:18 AM, Jakob Praher <jp at hapra.at> wrote:

> Why did you change to # for introducing function types and creating
> closures?
>

Because the # syntax for references to methods is already part of the Java
mindset from its use in javadoc.  That naturally generalizes to a
corresponding syntax for lambdas and therefore function types.


> But I think having to write:
>
>   int[] result = x.select( #(int c) c % 2 == 0)
>
> is harder to read. Don't you think?
>

Not especially.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/closures-dev/attachments/20091121/e1ffedb4/attachment.html 


More information about the closures-dev mailing list