|
|
|
Leavens, Gary T. and Millstein, Todd D. (1998) Multiple Dispatch as Dispatch on Tuples. Technical Report TR98-03a, Department of Computer Science, Iowa State University.
Abstract
Multiple Dispatch as Dispatch on Tuples
by
Gary T. Leavens and Todd D. Millstein
Abstract
Many popular object-oriented programming languages, such as C++,
Smalltalk-80, Java, and Eiffel, do not support multiple dispatch. Yet
without multiple dispatch, programmers find it difficult to express
binary methods and design patterns such as the ``visitor''
pattern. We describe a new, simple, and orthogonal way to add
multimethods to single-dispatch object-oriented languages, without
affecting existing code. The new mechanism also clarifies many
differences between single and multiple dispatch.
Keywords: Multimethods, generic functions, object-oriented programming
languages, single dispatch, multiple dispatch, tuples, product types,
encapsulation, modularity, static typechecking, subtyping,
inheritance, Tuple language.
1998 CR Categories:
D.3.1 [Programming Languages] Formal Definitions and Theory --- Semantics;
D.3.2 [Programming Languages] Language Classifications ---
object-oriented langauges;
D.3.3 [Programming Languages] Language Constructs and Features ---
Abstract data types, control structures, procedures, functions, and
subroutines;
D.3.m [Programming Languages] Miscellaneous --- multimethods,
generic functions, single dispatch, multiple dispatch, type systems;
F.3.3 [Logics and Meanings of Programs] Studies of Program Constructs ---
control primitives, type structures.
Contact site administrator at: ssg@cs.iastate.edu
|