stack-bound vs. travelling closures proposal.
Peter Levart
peter.levart at marand.si
Thu Jun 17 06:11:11 PDT 2010
On 06/17/10, Doug Lea wrote:
> On 06/17/10 08:19, Neal Gafter wrote:
> > You're observing that people don't use checked exceptions much today,
> > and they aren't well supported (e.g. in concurrency scenarios).
>
> That was one of the observations. The short version of the
> second one is that
> * We don't know how to efficiently process closures performing
> blocking or failing IO.
> * We don't have a reasonable way to ban only IO (or force
> explicit evasion of the ban) without banning all checked exceptions.
>
> -Doug
>
>
The last one could (speculating) be supported by introducing "negated types" and combining them with "conjunction types"...
An API could restrict the passed in closures to ever throw IOException like this:
public static <P, R, throws E extends Exception & !IOException> List<R> parallelMap(List<P> elements, #R(P)(throws E) mapFunction) throws E {...}
Regards, Peter
More information about the lambda-dev
mailing list