Abstract
Multivariant functions in Kea are a statically-typed form of the multi-methods of CLOS (Keene, 1989) but encapsulation is retained. Multivariants permit fine typing distinctions to be made, allow despatching to be avoided in some cases, and may be used to avoid some restrictions of the contravariance rule.
Once multivariant functions are introduced by example, the semantics of the despatch of multivariants are provided, based on the generation of despatching variants. Three issues arise with despatching: redundancy, ambiguity, and exhaustiveness of a (partially-ordered) set of variants with respect to a function call. It is shown that the approach taken here is consistent with separate compilation.
Preview
Unable to display preview. Download preview PDF.
References
Canning P S, Cook W R, Hill W L, Olthoff W G, 1989. Interfaces for strongly-typed object-oriented programming, OOPSLA'89, ACM SIGPLAN Notices, 24 (10) October, 1989, pp457–467.
Cardelli L, Wegner P, 1985. On understanding types, data abstraction, and polymorphism, Computing Surveys, 17(4), pp471–522.
Cook W, 1989. A proposal for making Eiffel type safe, in Cook S (Ed), ECOOP 89, Cambridge University Press, pp 57–70.
Dahl O J, Nygaard K, 1966. Simula — an Algol-based simulation language, CACM 9 (9), pp671–678.
Field A J, Harrison P G, 1988. Functional Programming, Addison-Wesley.
Goldberg A, Robson D, 1983. Smalltalk 80: The Language and its Implementation, Addison-Wesley.
Halbert D C, O'Brien P D, 1987. Using types and inheritance in object-oriented programming, IEEE Software, September 1987, pp71–79.
Hamer J, Hosking J G, Mugridge W B, 1989. Knowledge-based systems for representing codes of practice, Report 48, Department of Computer Science, University of Auckland, New Zealand.
Hamer J, 1990a. Expert Systems for codes of practice, PhD Thesis, Department of Computer Science, University of Auckland, New Zealand.
Hamer J, 1990b. Class Language runtime system: detailed specification, BRANZ Contract 85-024, Technical Report No. 9, Department of Computer Science, University of Auckland, New Zealand.
Hosking J G, Hamer J, Mugridge W B, 1990. Integrating functional and object-oriented programming, Procs. Pacific Tools 80 Conference, Sydney, Australia, November 1990.
Keene S E, 1989. Object-Oriented Programming in Common Lisp: A Programmer's Guide to CLOS, Addison-Wesley, 1989.
Meyer B, 1988. Object-Oriented Software Construction, Prentice Hall.
Mugridge W B, Hosking J G, Hamer J, 1990. Functional extensions to an object-oriented programming language, Report No. 49, Department of Computer Science, University of Auckland, New Zealand.
Mugridge W B, Hamer J, Hosking J G, 1991a. The semantics of multivariant functions, in preparation.
Mugridge W B, Hamer J, Hosking J G, 1991b. Type loss in statically-typed object-oriented proghramming languages, in preparation.
Smith J M, Smith D C P, 1977. Database abstractions: aggregation and generalization, ACM Trans. on Database Systems, 2 (2), 1977, pp105–133.
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 1991 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Mugridge, W.B., Hamer, J., Hosking, J.G. (1991). Multi-methods in a statically-typed programming language. In: America, P. (eds) ECOOP'91 European Conference on Object-Oriented Programming. ECOOP 1991. Lecture Notes in Computer Science, vol 512. Springer, Berlin, Heidelberg. https://doi.org/10.1007/BFb0057029
Download citation
DOI: https://doi.org/10.1007/BFb0057029
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-54262-9
Online ISBN: 978-3-540-47537-8
eBook Packages: Springer Book Archive