Link Details

Link 664927 thumbnail
User 811641 avatar

By dev.stonez
Published: Sep 09 2011 / 09:19

After considering a number of alternatives, we decided to essentially adopt the C# syntax. We may still deliberate further on the fine points (e.g., thin arrow vs fat arrow, special nilary form, etc), and have not yet come to a decision on method reference syntax. The decision to choose this syntax was twofold: - The syntax scores "pretty well" on most subjective measures (though has cases where it looks bad, just like all the others do). In particular, it does well with "small" lambdas that are used as method arguments (a common case), and also does well with large (multi-statement) lambdas. - Despite extensive searching, there was no clear winner among the alternatives (each form had some good aspects and some really not very good aspects, and there was no form that was clearly better than the others). So, we felt that it was better to choose something that has already been shown to work well in the two languages that are most like Java -- C# and Scala -- rather than to invent something new.
  • 37
  • 0
  • 6256
  • 68


Add your comment
User 338269 avatar

Miloskov replied ago:

0 votes Vote down Vote up Reply

finally closures to Java and catching C# features.

User 423119 avatar

eriksensei replied ago:

0 votes Vote down Vote up Reply

eek! arrows! oh noes!!! itz too complicated!!! 1 !!! 1

User 174509 avatar

philho replied ago:

0 votes Vote down Vote up Reply

A sensible move, using a syntax used in many languages already (not only C# and Scala; they took it from predecessors, but they might be the most used, thus the most widely known/popular examples), and that is quite readable (once you get used to it).
I wonder how they will implement it. Special bytecode or just adding some anonymous class wrapper automatically?

User 854623 avatar

forax replied ago:

1 votes Vote down Vote up Reply

a special bytecode introduces to support dynamic language in Java 7 (invokedynamic)

Add your comment

Html tags not supported. Reply is editable for 5 minutes. Use [code lang="java|ruby|sql|css|xml"][/code] to post code snippets.

Apache Hadoop
Written by: Piotr Krewski
Featured Refcardz: Top Refcardz:
  1. Play
  2. Akka
  3. Design Patterns
  4. OO JS
  5. Cont. Delivery
  1. Play
  2. Java Performance
  3. Akka
  4. REST
  5. Java