Built-in Types and Parameterized Types



next up previous contents index
Next: Any Up: No Title Previous: Reference Grammar

Built-in Types and Parameterized Types

This appendix supplements the material of Chapter 3 by providing a preliminary description of the built-in types and parameterized types. The definitions should be considered preliminary; we may very well make changes to them later.

All the built-in types except for "any" have "equal", "similar", "copy", and "unparse" methods. These methods are optional for the parameterized types such as "array[T]": an instantiation will have one of these methods only if each of the actual parameter types has the method.

None of the built-in types and parameterized types can have subtypes, except for "any", which is the supertype of all types. There is no type hierarchy relating any of the other built-in types, except that there is a rich hierarchy for routine types.

The built-in types and parameterized types are implemented by classes that cannot be subclassed.

The Theta environment contains a number of equates that describe various properties and limitations of the built-in types. The corresponding type definitions in this Appendix describe these equates in more detail.



theta-questions@lcs.mit.edu