Multi-return function call

  • Authors:
  • Olin Shivers;David Fisher

  • Affiliations:
  • College of Computing, Georgia Institute of Technology, GA, USA (email: shivers@cc.gatech.edu, dfisher@cc.gatech.edu);College of Computing, Georgia Institute of Technology, GA, USA (email: shivers@cc.gatech.edu, dfisher@cc.gatech.edu)

  • Venue:
  • Journal of Functional Programming
  • Year:
  • 2006

Quantified Score

Hi-index 0.00

Visualization

Abstract

It is possible to extend the basic notion of “function call” to allow functions to have multiple return points. This turns out to be a surprisingly useful mechanism. This article conducts a fairly wide-ranging tour of such a feature: a formal semantics for a minimal $\lambda$-calculus capturing the mechanism; motivating examples; monomorphic and parametrically polymorphic static type systems; useful transformations; implementation concerns and experience with an implementation; and comparison to related mechanisms, such as exceptions, sum-types and explicit continuations. We conclude that multiple-return function call is not only a useful and expressive mechanism, at both the source-code and intermediate-representation levels, but also quite inexpensive to implement.