Method reference double-colon syntax

Lukas Eder lukas.eder at gmail.com
Fri Jun 1 02:38:14 PDT 2012


I'm quite thrilled to see these ideas mentioned on the list here:

> #[ 1, 2, 3 ]                          // Array, list, set
> #{ "foo" : "bar", "blah" : "wooga" }  // Map literals
> #/(\d+)$/                             // Regex
> #(a, b)                               // Tuple
> #(a: 3, b: 4)                         // Record
> #"There are {foo.size()} foos"        // String literal

Array, list, set, and map literals would make a lot of Java code much
more concise. Tuple and Record literals on the other hand would
introduce a whole new set of features to the Java universe (with
appropriate backing language-support). Imagine interacting with
databases, when you could actually formally select tuples and records
(with their appropriate column/type combinations). This would have a
very high impact on standard APIs such as JDBC, JPA and proprietary
ones such as jOOQ and QueryDSL

> Not that we'd embrace all of these immediately (or ever),

Too bad :-) I've been missing those literals many times.


More information about the lambda-dev mailing list