Alternative syntax for closures
Neal Gafter
neal at gafter.com
Tue Jul 15 14:38:27 PDT 2008
And how is your method invoked? How do I get exception transparency for
non-trailing arguments?
On Tue, Jul 15, 2008 at 1:16 PM, Rémi Forax <forax at univ-mlv.fr> wrote:
> Neal Gafter a écrit :
>
>> Can you please show me how you intend one would write the equivalent of
>> the following BGGA method?
>>
>> *<throws E> void myIf(
>> boolean cond,
>> {=>void throws E} truePart,
>> {=>void throws E} falsePart) throws E {
>> (cond ? truePart : falsePart).invoke();
>> }
>> *
>>
>> Regards,
>> Neal
>>
> Voila :
> void myIf(boolean cond) truePart() falsePart() {
> if (cond)
> truePart().invoke();
> else
> falsePart().invoke();
> }
>
> Rémi
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/closures-dev/attachments/20080715/592da13c/attachment.html
More information about the closures-dev
mailing list