Exceptions, Continuations and Macro-expressiveness

  • Authors:
  • James Laird

  • Affiliations:
  • -

  • Venue:
  • ESOP '02 Proceedings of the 11th European Symposium on Programming Languages and Systems
  • Year:
  • 2002

Quantified Score

Hi-index 0.00

Visualization

Abstract

This paper studies the problem of expressing exceptions using first-class continuations in a functional-imperative language. The main result is that exceptions cannot be macro-expressed using first-class continuations and references (contrary to "folklore"). This is shown using two kinds of counterexample. The first consists of two terms which are equivalent with respect to contexts containing continuations and references, but which can be distinguished using exceptions. It is shown, however, that there are no such terms which do not contain callcc. However, there is a 驴1 sentence of first-order logic which is satisfied when interpreted in the domain of programs containing continuations and references but not satisfied in the domain of programs with exceptions and references. This is used to show that even when callcc is omitted from the source language, exceptions still cannot be expressed using continuations and references.