Alternative syntax for closures

Neal Gafter neal at gafter.com
Tue Jul 15 18:57:05 PDT 2008


On Tue, Jul 15, 2008 at 3:08 PM, Rémi Forax <forax at univ-mlv.fr> wrote:

> Neal Gafter a écrit :
>
>> And how is your method invoked?
>>
> like that:
> bolean cond=...
> myIf(cond) {
>  //true part
> } {
>  //false part
> }
>

Your syntax is ambiguous.  There is no way to tell if it is to be parsed as
a single invocation

   IDENTIFIER ( ARGS ) BLOCK BLOCK

or an invocation followed by a block

   IDENTIFIER ( ARGS ) BLOCK
   BLOCK


>  How do I get exception transparency for non-trailing arguments?
>>
> There is no way.


Then I presume there is also no way to declare local variables or fields to
store closures that have parametric exceptions, which rules out a number of
useful control APIs.  Your proposal is not just a different syntax for the
same semantics; it supports only a subset of the useful functionality of
BGGA.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/closures-dev/attachments/20080715/5ea535f8/attachment.html 


More information about the closures-dev mailing list