Kawa 1.11 released

Kawa 1.11 is now evailable from the usual places:

For a full list of changes, see the news page. Below are some highlights.

Improved object initialization

When constructing an object and there is no matching constructor method, look for " add " methods in addition to " set " methods. Also, allow passing constructor args as well as keyword setters. These features make it more convenient to allocate and initialize complex objects. See here for details and examples, including a simple but complete Swing application.

SAM-conversion

In a context that expects a Single Abstract Method (SAM) type (for example java.lang.Runnable ), if you pass a lambda you will get an object where the lambda implements the abstract method. For example, you can just write:

(button:addActionListener (lambda (e) (do-something)))

(button:addActionListener (object (java.awt.event.ActionListener) ((actionPerformed (e ::java.awt.event.ActionEvent))::void (do-something))))

Enumerations

instead of the equivalent but more long-winded:See here for more information.

A new define-enum form, contributed by Jamison Hope, makes it easy to define enuration types and values compatible with Java5 enums.

(define-enum colors (red blue green))

New Kawa logo

For more details and examples, see here Kawa new has a logo contributed by Jakub Jankiewicz: