Alternative syntax for closures

Neal Gafter neal at gafter.com
Tue Jul 15 12:23:11 PDT 2008


On Tue, Jul 15, 2008 at 10:05 AM, Rémi Forax <forax at univ-mlv.fr> wrote:

> FileReader reader=...
> with(reader) {
>  throw new AnotherException();
> }
>
> is compile like this:
>
> FileReader reader=...
> with(reader,new VVE() {
>  public void invoke() throws AnotherException {
>    throw new AnotherException();
>  }
> });
>
> here the compiler awaits two catch blocks
> to catch AnotherException and IOException.
>

I'd like to know what language rules you have in mind that would result in
the compiler inferring that this "with" invocation can throw
AnotherException.

As i said, i've just proposed a new syntax, not a new semantics.
>

Your handling of exceptions appears to be new semantics compared to BGGA,
and I don't yet understand how you intend it would work.

-Neal
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/closures-dev/attachments/20080715/3bc3d62c/attachment.html 


More information about the closures-dev mailing list