This is the mail archive of the
kawa@sourceware.org
mailing list for the Kawa project.
Re: easier Kawa object building with Swing example
- From: Helmut Eller <eller dot helmut at gmail dot com>
- To: kawa at sources dot redhat dot com
- Date: Tue, 05 Oct 2010 12:39:46 +0200
- Subject: Re: easier Kawa object building with Swing example
- References: <4CA602A3.5060701@bothner.com>
* Per Bothner [2010-10-01 15:47] writes:
> Two more new features: First "SAM-conversion" is applied when a
> lambda expression is provided in a context that requires a "SAM type",
> which is an interface or abstract class with a single abstract method.
> For example java.lang.Runnable or many XxxListener classes.
> In that case an anonymous class is created.
This doesn't seem to work threads:
(define (foo)
((java.lang.Thread (lambda ()
(format #t "foo\n")
(force-output))
"foo"
):start))
(foo)
=> Argument #1 (#<procedure /dev/stdin:52>) to
'java.lang.Thread.<init>(java.lang.Runnable,java.lang.String)' has wrong
type (gnu.expr.ModuleMethod) (gnu.expr.ModuleMethod cannot be cast to
java.lang.Runnable)
Helmut