\section{Objects} \label{object} This module unifies all types into one type, the Objects type. The Objects type is the sum of all other types (See sum types, section \ref{sums}). Recall that sum types are created from some set of member types, and functions are available to convert from values in the member types to values in the sum type. The objects type is the sum of every possible type that could exist: the entire set described by the ``types'' type, which is infinite. However, the objects type does not contain itself as a member of the sum, since duplicating its values inside itself would be redundant. The values in the Objects type are exactly the set of all possible addresses! Note that there is no dynamic typing and no subtyping. Values in other types are not values in the objects type; even though there is a one-to-one correspondence. \subsection{Implementation} The class objects-class, derived from class sum-type, implements the Objects type and has one instance. The address of the Objects type is available in the global variable *objects*. Like any sum address, the format for an object address includes the reference to the instance of its class in the type field (object-class in this case), and an address in the value field (composed of any type and a value in that type). The Objects type implements the functions for sum types CURRENT-TYPE and MAKE-SUM-CONSTRUCTOR but not GET-CONSTRUCTORS since that would return an infinite set. Calling MAKE-SUM-CONSTRUCTOR with the objects type for both arguments will return a conversion function from the objects type to itself, which is the identity function for Objects (a function taking an Object and returning the same object). This prevents multiple representations for addresses that are equal (since it is redundant to specify the type Objects twice, both in the type field of the outer address and in the type field of the inner address). This change was made in the addr module in DEFUN MAKE-SUM-CONSTRUCTOR. CURRENT-TYPE and ADDR-VALUE-EQUAL for sum types will work with no change for the object type. The ``members'' slot in the class object-class is unused instead of being a LISP list of member types since that list would be infinite. <>= (in-package max) (defclass object-class (sum-type) ((members)) ) ; declared *objects* global in addr module, by MAKE-SUM-CONSTRUCTOR ; since it references it (setf *objects* (make-type :class 'object-class :key 'OBJECT)) (add-init-hook #'(lambda () (add-name *objects* "objects"))) @