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

Reinier Zwitserloot reinier at zwitserloot.com
Wed Jul 7 20:11:39 PDT 2010


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 -> .... });

Just a thought.

--Reinier Zwitserloot


More information about the lambda-dev mailing list