Unconstraining genericity

Generic classes and especially generic collection libraries can be of great benefit for efficient software production. Constrained genericity is used to guarantee that the type provided as a parameter to a generic class such as a sorted list will offer the methods that class requires. We argue that constrained genericity is not really the appropriate mechanism for this purpose since it restricts a generic class to one kind of use for each element type. We introduce the concept of 'generic procedure parameters' which allow the properties of a collection class to be specified in the instantiation rather than via the properties of the elements. We show that the concept is very efficiently implementable, more powerful than constrained genericity and more useful for the practical construction of complex data collections.

[1]  G. G. Stokes "J." , 1890, The New Yale Book of Quotations.

[2]  John C. Mitchell,et al.  Polymorphism and Subtyping in Interfaces , 1994, Workshop on Interface Definition Languages.

[3]  John C. Mitchell,et al.  F-bounded polymorphism for object-oriented programming , 1989, FPCA.

[4]  Kim B. Bruce,et al.  Subtyping Is Not a Good "Match" for Object-Oriented Languages , 1997, ECOOP.

[5]  Adele Goldberg,et al.  SmallTalk 80: The Language , 1989 .

[6]  Martín Abadi,et al.  A Theory of Objects , 1996, Monographs in Computer Science.

[7]  Luca Cardelli,et al.  Modula-3 language definition , 1992, SIGP.

[8]  Florian Matthes,et al.  Integrating Subtyping, Matching and Type Quantification: A Practical Perspective , 1996, ECOOP.

[9]  Andrew C. Myers,et al.  Subtypes vs. where clauses: constraining parametric polymorphism , 1995, OOPSLA.

[10]  Guy L. Steele,et al.  The Java Language Specification , 1996 .

[11]  Martin Odersky,et al.  Pizza into Java: translating theory into practice , 1997, POPL '97.

[12]  David R. Musser,et al.  STL tutorial and reference guide - C++ programming with the standard template library , 1996, Addison-Wesley professional computing series.

[13]  Luca Cardelli,et al.  On understanding types, data abstraction, and polymorphism , 1985, CSUR.

[14]  Bjarne Stroustrup,et al.  C++ Programming Language , 1986, IEEE Softw..

[15]  Paul Roe,et al.  Lightweight Parametric Polymorphism for Oberon , 1997, JMLC.

[16]  Andrew C. Myers,et al.  Parameterized types for Java , 1997, POPL '97.

[17]  Al Stevens,et al.  C programming , 1990 .

[18]  Bertrand Meyer,et al.  Eiffel: The Language , 1991 .

[19]  Claus H. Pedersen,et al.  Extending ordinary inheritance schemes to include generalization , 1989, OOPSLA '89.

[20]  David C. Luckham,et al.  Polymorphism and Subtyping in Interfaces , 1994, Workshop on Interface Definition Languages.

[21]  Luca Cardelli,et al.  On Binary Methods , 1995, Theory Pract. Object Syst..

[22]  William R. Cook,et al.  A Proposal for Making Eiffel Type-Safe , 1989, Comput. J..

[23]  Mark Evered,et al.  How Well Do Inheritance Mechanisms Support Inheritance Concepts? , 1997, JMLC.

[24]  C. H. Pedersen Extending ordinary inheritance schemes to include generalization , 1989, OOPSLA 1989.