ACM Home Page
Please provide us with feedback. Feedback
Type extension through polymorphism
Full text PdfPdf (299 KB)
Source ACM Transactions on Programming Languages and Systems (TOPLAS) archive
Volume 12 ,  Issue 1  (January 1990) table of contents
Pages: 135 - 138  
Year of Publication: 1990
ISSN:0164-0925
Author
F. Warren Burton  Department of Computer Science, 3190 MEB, University of Utah, Salt Lake City, UT
Publisher
ACM  New York, NY, USA
Bibliometrics
Downloads (6 Weeks): 3,   Downloads (12 Months): 38,   Citation Count: 4
Additional Information:

abstract   references   cited by   index terms   collaborative colleagues  

Tools and Actions: Request Permissions Request Permissions    Review this Article  
DOI Bookmark: Use this link to bookmark this Article: http://doi.acm.org/10.1145/77606.214515
What is a DOI?

ABSTRACT

A record data type can be extended by addition of more fields. The extended type is a subtype of the original, in that any value of the extended type can be regarded as a value of the original type by ignoring the additional fields. This results in a type hierarchy. Milner [3] has proposed a polymorphic type system. With the Milner approach, the type of a function may contain type variables. This also results in a type hierarchy. In a language with a polymorphic type system, if it is anticipated that a record type will need to be extended, then the record type can be defined to have a dummy extension field. In the parent type, the extension field will have null contents of type void. The type of the extension field can differ with different subtypes. The approach can be extended to allow a type to be subtype of two or more parent types. To a limited extent, this approach can be used in Ada and other languages with generic program units.