Advertisement

Multi-methods in a statically-typed programming language

  • Warwick B. Mugridge
  • John Hamer
  • John G. Hosking
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 512)

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.

Keywords

object-oriented multi-methods static-typing polymorphism contravariance 

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. 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.CrossRefGoogle Scholar
  2. Cardelli L, Wegner P, 1985. On understanding types, data abstraction, and polymorphism, Computing Surveys, 17(4), pp471–522.CrossRefGoogle Scholar
  3. Cook W, 1989. A proposal for making Eiffel type safe, in Cook S (Ed), ECOOP 89, Cambridge University Press, pp 57–70.Google Scholar
  4. Dahl O J, Nygaard K, 1966. Simula — an Algol-based simulation language, CACM 9 (9), pp671–678.MATHGoogle Scholar
  5. Field A J, Harrison P G, 1988. Functional Programming, Addison-Wesley.Google Scholar
  6. Goldberg A, Robson D, 1983. Smalltalk 80: The Language and its Implementation, Addison-Wesley.Google Scholar
  7. Halbert D C, O'Brien P D, 1987. Using types and inheritance in object-oriented programming, IEEE Software, September 1987, pp71–79.Google Scholar
  8. 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.Google Scholar
  9. Hamer J, 1990a. Expert Systems for codes of practice, PhD Thesis, Department of Computer Science, University of Auckland, New Zealand.Google Scholar
  10. 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.Google Scholar
  11. Hosking J G, Hamer J, Mugridge W B, 1990. Integrating functional and object-oriented programming, Procs. Pacific Tools 80 Conference, Sydney, Australia, November 1990.Google Scholar
  12. Keene S E, 1989. Object-Oriented Programming in Common Lisp: A Programmer's Guide to CLOS, Addison-Wesley, 1989.Google Scholar
  13. Meyer B, 1988. Object-Oriented Software Construction, Prentice Hall.Google Scholar
  14. 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.Google Scholar
  15. Mugridge W B, Hamer J, Hosking J G, 1991a. The semantics of multivariant functions, in preparation.Google Scholar
  16. Mugridge W B, Hamer J, Hosking J G, 1991b. Type loss in statically-typed object-oriented proghramming languages, in preparation.Google Scholar
  17. Smith J M, Smith D C P, 1977. Database abstractions: aggregation and generalization, ACM Trans. on Database Systems, 2 (2), 1977, pp105–133.CrossRefGoogle Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 1991

Authors and Affiliations

  • Warwick B. Mugridge
    • 1
  • John Hamer
    • 1
  • John G. Hosking
    • 1
  1. 1.Department of Computer ScienceUniversity of AucklandAucklandNew Zealand

Personalised recommendations