Abstract
This paper proposes an extension of the notion of method as it is currently used in most object-oriented languages. We define polymethods as methods that we can attach directly to types, as opposed to classes and that we can describe with a second-order type. Two benefits result from this extension; first, the expressive power of the language is improved with better modeling abilities. Next, second-order types yield a more powerful (precise) type inference, which extends the range of static type checking in a truly extensible object-oriented language. We first show that extensible object-oriented languages present many difficulties for static type-checking and that second-order types are necessary to get stronger type-checking. We illustrate how to combine polymethods through type inheritance and propose a technique based on abstract interpretation to derive a second-order type for new polymethods.
Keywords
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.
This is a preview of subscription content, log in via an institution.
Buying options
Tax calculation will be finalised at checkout
Purchases are for personal use only
Learn about institutional subscriptionsPreview
Unable to display preview. Download preview PDF.
References
A. Aiken, B. R. Murphy: Static Type Inference in a Dynamically Typed Language. Proc. of the 18th Symposium on Principles of Programming Languages, 1991.
H. Ait-Kaci, A. Podelski. The Meaning of Life. PRL Research Report, DEC, 1990.
L. Cardelli: Typeful Programming. DEC SRC report #5, 1989.
Y. Caseau: “A Model For a Reflective Object-Oriented Language,” Sigplan Notices, Special Issue on Concurent Object-Oriented Programming, 1989.
Y. Caseau: An Object-Oriented Language for Advanced Applications. Proc. of TOOLS USA 91, 1991.
P. Cousot, R. Cousot: Abstract Interpretation: A Unified Model for Static Analysis of Programs by Constructions or Approximation of Fixpoints. Proc. Fourth ACM symposium of Principles of Programming Languages, 1977.
W. Cook, W. Hill, P. Canning: Inheritance is not Subtyping. Proc. of the 17th ACM Symposium on Principles of Programming Languages, San Francisco, 1990.
W. Cook, J. Palsberg: A Denotational Semantics of Inheritance and its Correctness. Proc. of OOPSLA-89, New Orleans, 1989.
Y. Caseau, L. Perron: A type System for Object-Oriented Database Programming and Querying Languages. Proc. of International Workshop on DataBase Programming Languages, 1991.
L. Cardelli, P. Wegner: On understanding types, data abstraction, and polymorphism. ACM Computing Surveys, vol 17 n. 4, 1985.
C. Dony: Exception Handling and Object-Oriented Programming: Towards a Synthesis. Proc. of OOPSLA’90, Ottawa, 1990.
D.P. Friedman, M. Wand: Reification: Reflection without Metaphysics. ACM Symposium on LISP and Functional Programming, Austin, August 1984.
J. Graver, R. Johnson: A Type System for Smalltalk. Proc. of the 17th ACM Symposium on Principles of Programming Languages, San Francisco, 1990.
J. Goguen, J. Meseguer: Eqlog: Equality, Types and Generic Modules for Logic Programming. In Logic Programming, Functions, Relations and Equations, Eds. D. DeGroot, G. Lindstrom, Prentice Hall, 1986.
L. Geurts, L. Meertens, S. Pemberton: ABC Programmer’s Handbook. Prentice-Hall, 1990.
A. Goldberg, D. Robson: Smalltalk-80: The language and its implementation. Addison-Wesley, 1983.
F. Henglein, H. G. Mairson: The Complexity of Type Inference for Higher-Order Typed Lambda Calculi. Proc. of the 18th Symposium on Principles of Programming Languages, 1991.
R. Harper, D.B. MacQueen, R. Milner: Standard ML. Report ECS-LFCS-86-2, Dept. of Computer Science, University of Edimburgh, 1986.
R. Johnson, J, Grauer, L. Zurawski: TS: An Optimizing Compiler for Smalltalk. OOPSLA-89, New Orleans, 1989.
C. Lecluse, P. Richard: Modelling Complex Structures in Object-Oriented Databases. Proc. of ACM PODS, 1989.
B. Meyer: Static Typing for Eiffel. Interactive Software Engineering, July, 1989.
R. Milner: A theory of type polymorphism in programming. In j. Computer and System Sciences vol 17 n. 3, 1978.
J. Mitchell: Towards a Typed Foundation for Method Specialization and Inheritance. Proc. of the 17th ACM Symposium on Principles of Programming Languages, San Francisco, 1990.
J. Mitchell, S. Meldal, N. Madhav: An Extension of Standard ML modules with subtyping and inheritance. Proc. of the 18th Symposium on Principles of Programming Languages, 1991.
P. Maes, D. Nardi: Meta-level Architecture and Reflection. Elsevier Science Publication (North Holland), 1988.
A. Ohori, P. Buneman: Static Type Inference for Parametric Classes. OOPSLA-89, New Orleans, 1989.
A. Ohori, P. Buneman, V. Breazu-Tannen: Database Programming in Machiavelli-a Polymorphic Language with Static Type Inference. ACM SIGMOD Conf. on Management of Data, May 1989.
J. Palsberg, M. I. Schwartzbach: Static Typing for Object-Oriented Programming. DAIMI PB-355, June 1991.
J. Palsberg, M. I. Schwartzbach: Safety Analysis versus Type Inference for Partial Types. DAIMI PB-404, July 1992.
U. Reddy: Objects as Closures: Abstract Semantics of Object-Oriented Languages. Proc. ACM Conference on LISP and Functional Programming, 1988.
A. Scedrov: A Guide to Polymorphic Types. Logic and Computer Science, Academic Press, 1990.
G. Smolka: Logic Programming over Polymorphically Order-Sorted Types. PhD Thesis, Universität Kaiserslautern, May 1989.
B. Stroustrup: The C++ Programming Language. Addison-Wesley, 1986.
A. Skarra, S. Zdonik: Type Evolution in an Object-Oriented Database. In Research Directions in Object Oriented Programming, ed. B. Schriver and P. Wegner, MIT press, 1987.
M. Wand: Complete Type Inference for Simple Objects. Proc. IEEE Symposium on Logic in Computer Science.
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 1993 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Caseau, Y., Perron, L. (1993). Attaching Second-Order Types to Methods in an Object-Oriented Language. In: Nierstrasz, O.M. (eds) ECOOP’ 93 — Object-Oriented Programming. ECOOP 1993. Lecture Notes in Computer Science, vol 707. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-47910-4_9
Download citation
DOI: https://doi.org/10.1007/3-540-47910-4_9
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-57120-9
Online ISBN: 978-3-540-47910-9
eBook Packages: Springer Book Archive