Sciweavers

OOPSLA
1995
Springer

Subtypes vs. Where Clauses: Constraining Parametric Polymorphism

13 years 8 months ago
Subtypes vs. Where Clauses: Constraining Parametric Polymorphism
All object-oriented languages provide support for subtype polymorphism, which allows the writing of generic code that works for families of related types. There is also a need, however, to write code that is generic across types that have no real family relationship. To satisfy this need a programming language must provide a mechanism for parametric polymorphism, allowing for types as parameters to routines and types. We show that to support modular programming and separate compilation there must be a mechanism for constraining the actual parameters of the routineor type. We describe a simple and powerfulconstraint mechanism and compare it with constraint mechanisms in other languages in terms of both ease of use and semantic expressiveness. We also discuss the interaction between subtype and parametric polymorphism: we discuss the subtype relations that can exist between instantiations of parameterized types, and which of those relations are useful and can be implemented efficiently...
Mark Day, Robert Gruber, Barbara Liskov, Andrew C.
Added 26 Aug 2010
Updated 26 Aug 2010
Type Conference
Year 1995
Where OOPSLA
Authors Mark Day, Robert Gruber, Barbara Liskov, Andrew C. Myers
Comments (0)