Xref: utzoo comp.lang.smalltalk:1366 comp.lang.eiffel:415 Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!hellgate.utah.edu!helios.ee.lbl.gov!ucsd!hub!eiffel!bertrand From: bertrand@eiffel.UUCP (Bertrand Meyer) Newsgroups: comp.lang.smalltalk,comp.lang.eiffel Subject: Re: Class an object? Keywords: class Message-ID: <198@eiffel.UUCP> Date: 9 Sep 89 17:17:05 GMT References: <6319@latcs1.oz> Organization: Interactive Software Engineering, Santa Barbara CA Lines: 63 From article <6319@latcs1.oz> by tanp@latcs1.oz (Tan Poh Lee): > I like to have some clarification on several questions about class. > > 1. Is a class an object? Not in Eiffel, but you can create an object representing a class. If you use the facilities from the Eiffel Support Library, you can obtain an instance of type E_CLASS by class_descriptor := universe.item ("CLASS_NAME") Here ``universe'', of type UNIVERSE (another library class) is a reference to the description of a ``universe'', or set of classes. A universe is obtained on Unix by specifying an arbitrary list of directories; the universe contains all the classes that reside in any of these directories. Once you have obtained ``class_descriptor'' in this way, you can apply to it all sorts of features to get every possible information about the class: full class text, abstract text (this is a form showing only the interface, including assertions), text of individual routines, list of features and their signatures (or routines only, functions only, procedures only etc.), parents, ancestors, clients, suppliers etc. > > 2. Does it have a unique system identifier like the object? All the classes in a universe have different names. (When a duplicate name is found in the process described above for obtaining a universe from a list of directories, only the first class of each name is kept.) Whether the implementation also decides to have a unique identifier for each class is, in this context, irrelevant to programmers. > > 3. Object has a system/object identifier, value and associated methods. > Is it right to say that a class have system identifier, value domain, > methods and a NAME? Sorry, I don't understand (beyond the answers given above). > 4. Is a tuple object which consists of another tuple object (ie. only one > composition level) regarded as a complex object? > An example: > O1 : > O4 : > Is O1 a complex object? The current version of Eiffel includes a notion of expanded types and composite objects. Then if I understand the question properly the answer is yes in eiffel. > I am aware some object-oriented languages do not have class concept. An object-oriented language without a notion of class seems to me like a meal without cheese (``Un repas sans fromage est comme une belle a qui il manque un oeil'', Brillat-Savarin, quoted by Flaubert in Le Dictionnaire des Idees recues). > If you have any language in mind with respect to the answers of the > questions above, please mention it. Thanks. Eiffel. For any more information see the book ``Eiffel: The Language'' (also known as the Eiffel Reference Manual), recently announced on comp.lang.eiffel. -- Bertrand Meyer bertrand@eiffel.com