JUCS - Journal of Universal Computer Science 3(2): 120-146, doi: 10.3217/jucs-003-02-0120
Type Compatibility for Extensible Module Types, Their Reference Parameters, and Their Pointer Types
expand article infoJürgen F. H. Winkler
‡ Friedrich Schiller University Jena, Germany
Open Access
Abstract
Objects in object-oriented languages have often been treated as a special kind of entity different from other variables or constants. Similarly, their types, which are typically called classes, have often been treated differently from other types. This complicates the understanding of these concepts. The present paper proposes to see the classes as module types leading to a very natural integration of objects and classes into the framework of contemporary programming languages. The main part of the paper contains typing rules for module types for assignment and for value and variable parameters. It is shown that the rules for reference parameters in some existing languages lead to unexpected results and sometimes to undefined behavior. Furthermore, assignment involving dereferenced pointers to modules is studied for the first time in detail. The paper shows that the type compatibility rule for pointer assignment is not sufficient for deref assignment. The last part of the paper contains a comparison of the language definitions and of compilers for Borland Pascal with Objects, C++, Oberon, and Object CHILL.
Keywords
Object-Oriented languages, extensible module types, parameters and parameter passing, deref assignment, Borland Pascal with Objects, C++, Oberon, Object CHILL