Dependent classes
Authors:
Open Access
- 21 October 2007
- journal article
- Published by Association for Computing Machinery (ACM) in ACM SIGPLAN Notices
- Vol. 42 (10) , 133-152
Abstract
Virtual classes allow nested classes to be refined in subclasses. In this way nested classes can be seen as dependent abstractions of the objects of the enclosing classes. Expressing dependency via nesting, however, has two limitations: Abstractions that depend on more than one object cannot be modeled and a class must know all classes that depend on its objects. This paper presents dependent classes , a generalization of virtual classes that expresses similar semantics by parameterization rather than by nesting. This increases expressivity of class variations as well as the flexibility of their modularization. Besides, dependent classes complement multimethods in scenarios where multi-dispatched abstractions rather than multi-dispatched methods are needed. They can also be used to express more precise signatures of multimethods and even extend their dispatch semantics. We present a formal semantics of dependent classes and a machine-checked type soundness proof in Isabelle/HOL [29], the first of this kind for a language with virtual classes and path-dependent types.Keywords
This publication has 25 references indexed in Scilit:
- Statically scoped object adaptation with expanders2006
- A Core Calculus for Scala Type CheckingLecture Notes in Computer Science, 2006
- Lightweight Family Polymorphism2005
- Scalable extensibility via nested inheritanceACM SIGPLAN Notices, 2004
- A Nominal Theory of Objects with Dependent Types2003
- Featherweight JavaACM Transactions on Programming Languages and Systems, 2001
- MultiJavaACM SIGPLAN Notices, 2000
- Modular Statically Typed MultimethodsLecture Notes in Computer Science, 1999
- A Syntactic Approach to Type SoundnessInformation and Computation, 1994
- The calculus of constructionsInformation and Computation, 1988