Multi-return function call

  • Authors:
  • Olin Shivers;David Fisher

  • Affiliations:
  • Georgia Tech College of Computing;Georgia Tech College of Computing

  • Venue:
  • Proceedings of the ninth ACM SIGPLAN international conference on Functional programming
  • Year:
  • 2004

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 paper conducts a fairly wide-ranging tour of such a feature: a formal semantics for a minimal λ -calculus capturing the mechanism; a motivating example; a static type system; 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, both at the source-code and intermediate-representation level, but is also quite inexpensive to implement.