unrestricted closures
Neal Gafter
neal at gafter.com
Sun Nov 16 15:50:46 PST 2008
Right: (with or without closures) there is no guarantee that any particular
method completes normally unless it is specified to do so.
On Sun, Nov 16, 2008 at 3:44 PM, Vladimir Kirichenko <
vladimir.kirichenko at gmail.com> wrote:
> Neal Gafter wrote:
>
>> All of the examples I've seen where you could get into this kind of
>> "trouble" involve making locally obvious errors. The exception points you
>> precisely to where you made the mistake, too. In this case the temp()
>> method clearly constructs a closure that should not escape its scope (it has
>> a return in it) yet is assigned to a static variable.
>>
>
> The main point was to show that after the
>
> unrestrictedClosure.invoke()
>
> there are to guaranty that the following statements will execute.
>
> so there will be no exception but the code will not be executed:
>
> void m ({int ===> void} t) {
>
> t.invoke(i);
>
> System.out.println("who knows if we ever get here...");
>
> }
>
> Doesn't it look strange?
>
> --
> Best Regards,
> Vladimir Kirichenko
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/closures-dev/attachments/20081116/fcd56609/attachment.html
More information about the closures-dev
mailing list