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.
2016
9781450344395
9781450344395
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.

Utilizza questo identificativo per citare o creare un link a questo documento: https://hdl.handle.net/11567/858553
Citazioni
  • ???jsp.display-item.citation.pmc??? ND
  • Scopus 0
  • ???jsp.display-item.citation.isi??? ND
social impact