next up previous contents
Next: IO Up: Basic Classes Previous: Basic Classes   Contents

Object

The Object class is the root of the inheritance graph. Even the other basic classes (e.g., IO and Int) inherit from Object (and thus inherit the three methods listed below). It is an error to redefine Object. Methods with the following declarations are defined:
abort() : Object
type_name() : String
copy() : SELF_TYPE
The method abort flushes all output and then halts program execution with the error message "abort\n".

The method type_name returns a string with the name of the (run-time, dynamic) class of the object. The method copy produces a shallow copy of the object.4