[plt-scheme] OT: kawa

From: Dominique Boucher (dominique.boucher at nuecho.com)
Date: Wed Feb 11 11:27:46 EST 2004


> There was sometimes weirdness with attempting to build Swing-based
> using Kawa; you really couldn't easily make new implementations of
> interfaces to pass in as Listener objects.  

The latest version (at least) supports this quite well. For example,
suppose you have a Java interface like:

public interface Command {
  public void execute();

You can create the equivalent of anonymous classes in Kawa using the
'object' syntax:

  (let ((command (object (<Command>)
                   ((execute) :: <void
                    ...)))) ; some Scheme code

I do this all the time. Also, the body of methods you declare in the
'object' form can refer to variables in the lexical scope, without the
restrictions of the Java anonymous classes (that all free variables are
final in the surrounding context).

> The other problem was that (at the time) there were a lot of odd
> "features" in the language that it was not trivial to disable.
> Example: this code is broken:
>     (let ((foo: "hello"))
>        (string-length foo:))

> Oh, one more thing: you are going to have to give up SYNTAX-CASE
> that and full-featured continuations.  At this point, I think I'd miss
> the former more than the latter).

Kawa do have syntax-case now. But no syntax objects, though.

Dominique Boucher
NuEcho Inc. 

Posted on the users mailing list.