closures after all?
Paul Benedict
pbenedict at apache.org
Wed Nov 18 14:10:18 PST 2009
This part of the closures spec is very interesting:
>> Locks.<throws IOException|NumberFormatException>withLock(lock, #(){
>> System.out.println("hello");
>> });
>> You can think of this kind of type parameter accepting disjunction, "or" types.
>> That is to allow it to match the exception signature of a function that throws
>> any number of different checked exceptions. If the block throws no exceptions,
>> the type argument would be the type Nothing (see below).
Since the enhanced try/catch using disjunctive Exception types was
thrown out (pun intended) because it "ventured too close to the type
system", doesn't the inclusion if closures make rejecting his proposal
silly? After all, the impact of closures is WAY beyond project coin.
Can his enhanced exception catching be re-considered? It obviously now
has some support with the new closure syntax.
Paul
More information about the coin-dev
mailing list