state-of-the-lambda syntax for non-SAM types such as WindowAdapter.

Stephen Colebourne scolebourne at joda.org
Thu Jul 8 02:32:54 PDT 2010


On 8 July 2010 04:11, Reinier Zwitserloot <reinier at zwitserloot.com> wrote:
> An idea:
>
> The state-of-the-lambda document allows lambda literals to be explicitly
> typed:
>
> Comparator<String> {a, b -> return a.length() - b.length()};
>
>
> What if one could also append the method to this? Then these closures can
> extend to non-SAM types:
>
> frame.addWindowListener(WindowAdapter.windowClosed {e -> .... });

We had this in early FCM versions, but took it out as it complicates
matters for a small use case.

Stephen


More information about the lambda-dev mailing list