1999
DOI: 10.1145/301631.301638
|View full text |Cite
|
Sign up to set email alerts
|

The design of a class mechanism for Moby

Abstract: Typical class-based languages, such as C++ and JAVA, provide complex class mechanisms but only weak module systems. In fact, classes in these languages incorporate many of the features found in richer module mechanisms. In this paper, we describe an alternative approach to designing a language that has both classes and modules. In our design, we rely on a rich ML-style module system to provide features such as visibility control and parameterization, while providing a minimal class mechanism that includes only… Show more

Help me understand this report

Search citation statements

Order By: Relevance

Paper Sections

Select...
2
1
1
1

Citation Types

0
14
0

Year Published

2000
2000
2012
2012

Publication Types

Select...
3
3

Relationship

2
4

Authors

Journals

citations
Cited by 13 publications
(14 citation statements)
references
References 15 publications
0
14
0
Order By: Relevance
“…Each class declares a record type of its instance variables, using the of clause. Superclass instance variables are inherited: the representation type of a class C is the representation type (recursively) of its direct superclass (if any) Each class declaration also implicitly declares a constructor, similar to constructor declarations in OCaml [Rémy and Vouillon 1998] and XMOC [Fisher and Reppy 2000], a core language for Moby [Fisher and Reppy 1999]. For example, the CListSet constructor expects arguments es of type int list and c of type int, initializes inherited instance variables via the call ListSet(es) to the superclass constructor, and initializes the new count instance variable to c. In general, the arguments to the superclass constructor call and the instance-variable initializers may be arbitrary expressions.…”
Section: Classesmentioning
confidence: 99%
“…Each class declares a record type of its instance variables, using the of clause. Superclass instance variables are inherited: the representation type of a class C is the representation type (recursively) of its direct superclass (if any) Each class declaration also implicitly declares a constructor, similar to constructor declarations in OCaml [Rémy and Vouillon 1998] and XMOC [Fisher and Reppy 2000], a core language for Moby [Fisher and Reppy 1999]. For example, the CListSet constructor expects arguments es of type int list and c of type int, initializes inherited instance variables via the call ListSet(es) to the superclass constructor, and initializes the new count instance variable to c. In general, the arguments to the superclass constructor call and the instance-variable initializers may be arbitrary expressions.…”
Section: Classesmentioning
confidence: 99%
“…MOBY is a language that combines an ML-style module system with classes and objects [FR99a]. Object types are related by structural subtyping, which is extended to other types in the standard way.…”
Section: The Problem With Friendsmentioning
confidence: 99%
“…From the programmer's perspective, a more natural approach is to make the classes themselves serve the rôle of types when this connection is needed. In this section and the next, we describe an extension to MOBY [FR99a] that has class types and inheritancebased subtyping. We describe two alternative approaches to typing this extension.…”
Section: Extended Mobymentioning
confidence: 99%
See 2 more Smart Citations