Integrating coercion with subtyping and multiple dispatch

  • Authors:
  • J. J. Hallett;Victor Luchangco;Sukyoung Ryu;Guy L. Steele, Jr.

  • Affiliations:
  • Boston University;Sun Microsystems;Sun Microsystems;Sun Microsystems

  • Venue:
  • Proceedings of the 2008 ACM symposium on Applied computing
  • Year:
  • 2008

Quantified Score

Hi-index 0.00

Visualization

Abstract

Coercion can greatly improve the readability of programs, especially in arithmetic expressions. However, coercion interacts with other features of programming languages, particularly subtyping and overloaded functions and operators, in ways that can produce surprising behavior. We study examples of such surprising behavior in existing languages. This study informs the design of the coercion mechanism of Fortress, an object-oriented language with multiple dynamic dispatch, multiple inheritance and user-defined coercion. We describe this design and show how its restrictions on overloaded declarations prevent ambiguous calls due to coercion.