Project Lambda: Java Language Specification draft
Alex Blewitt
alex.blewitt at gmail.com
Fri Jan 22 16:47:07 PST 2010
On 23 Jan 2010, at 00:37, Alex Buckley <Alex.Buckley at Sun.COM> wrote:
> Alex Blewitt wrote:
>> On 22 Jan 2010, at 22:55, Alex Buckley <Alex.Buckley at Sun.COM> wrote:
>>> * Exceptions
>>>
>>> [11.2.1 Exception Analysis of Expressions]
>>>
>>> A lambda invocation expression on a lambda expression of type
>>> #T(S1..Sm)(X1..Xn) can throw an exception type E iff either:
> No. The body of the lambda expression is able to throw whatever
> unchecked exceptions it likes, akin to the body of a method.
I agree that makes sense, but you used "if and only if" here. In other
words, this prevents RuntimeExceptiond from propagating unless
declared, at least in the descriptive sections included here. If there
is somewhere else in 11.2.1 which gives a free ride for
RuntimeException in lambda expressions/blocks, then that's ok. But I
didn't see the part of the spec that addressed this issue.
>> Does it also prevent throwing an EOFException if you've only
>> declared IOException in the list?
>
> It shouldn't prevent it, but technically it does. I am reminded of
> some changes to 11.2 that Neal raised years ago; time to sync them up.
Right, I was thinking that ww would need to consider super/subtype
relations too.
Alex
More information about the lambda-dev
mailing list