Exceptional syntax
From the points of view of programming pragmatics, rewriting and operational semantics, the syntactic construct used for exception handling in ML-like programming languages, and in much theoretical work on exceptions, has subtly undesirable features. We propose and discuss a more well-behaved construct.
Lire maintenant ?
gasche
L’idée principale est de combiner les deux syntaxes
let x = foo in barettry foo with bazen une syntaxe communelet-try x = foo with baz in bar, ayant la sémantique suivante: sifoorenvoie une erreur, on la passe àbazet on renvoie le résultat (ou on la propage), et sinon on évaluebarqui peut contenir la variablex.Ça permet de simplifier et de rendre plus efficace l’exemple classique:
en