Kawa 1.11 released
Kawa 1.11 is now evailable from the usual places:ftp://ftp.gnu.org/pub/gnu/kawa/kawa-1.11.tar.gz (source code)
ftp://ftp.gnu.org/pub/gnu/kawa/kawa-1.11.jar (runnablejar
)
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)))instead of the equivalent but more long-winded:
(button:addActionListener (object (java.awt.event.ActionListener) ((actionPerformed (e ::java.awt.event.ActionEvent))::void (do-something))))See here for more information.
Enumerations
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))For more details and examples, see here.
New Kawa logo
Kawa new has a logo contributed by Jakub Jankiewicz: