We propose an alternative to the usual try-catch construct, where catch clauses are coupled with the declaration of a local variable, rather than with an arbitrary expression. That is, in case initialization of the local variable fails, they provide an alternative computation which does not depend on such variable. This alternative mechanism subsumes the standard one and allows a more natural and functional programming style. We illustrate such advantages by some paradigmatic examples. The proposal is formalized as an extension of Featherweight Java (FJ) with a type system which can be proved to be sound.
Coupling catch clauses with local declarations
ZUCCA, ELENA
2016-01-01
Abstract
We propose an alternative to the usual try-catch construct, where catch clauses are coupled with the declaration of a local variable, rather than with an arbitrary expression. That is, in case initialization of the local variable fails, they provide an alternative computation which does not depend on such variable. This alternative mechanism subsumes the standard one and allows a more natural and functional programming style. We illustrate such advantages by some paradigmatic examples. The proposal is formalized as an extension of Featherweight Java (FJ) with a type system which can be proved to be sound.File in questo prodotto:
Non ci sono file associati a questo prodotto.
I documenti in IRIS sono protetti da copyright e tutti i diritti sono riservati, salvo diversa indicazione.