Middlesex University Research Repository

Total Page:16

File Type:pdf, Size:1020Kb

Middlesex University Research Repository Middlesex University Research Repository An open access repository of Middlesex University research http://eprints.mdx.ac.uk Clark, Tony (1997) Metaclasses and reflection in smalltalk. Technical Report. University of Bradford. Available from Middlesex University’s Research Repository at http://eprints.mdx.ac.uk/6181/ Copyright: Middlesex University Research Repository makes the University’s research available electronically. Copyright and moral rights to this thesis/research project are retained by the author and/or other copyright owners. The work is supplied on the understanding that any use for commercial gain is strictly forbidden. A copy may be downloaded for personal, non-commercial, research or study without prior permission and without charge. Any use of the thesis/research project for private study or research must be properly acknowledged with reference to the work’s full bibliographic details. This thesis/research project may not be reproduced in any format or medium, or extensive quotations taken from it, or its content changed in any way, without first obtaining permission in writing from the copyright holder(s). If you believe that any material held in the repository infringes copyright law, please contact the Repository Team at Middlesex University via the following email address: [email protected] The item will be removed from the repository while any claim is being investigated. Metaclasses and Reection in Smalltalk A N Clark Department of Computing University of Bradford Bradford West Yorkshire BD DP UK email ANClarkcompbradacuk tel Septemb er Keywords ob jectoriented metaob jects reection inheritance message passing Abstract Many Ob jectOriented Programming Languages provide reective features which may b e used to control the interpretive mechanism of the language Often these features are dened with resp ect to a golden braid consisting of ob jects classes and metaclasses This pap er describ es the Smalltalk golden braid and generalize it for multiple inheritance Multiple inheritance leads to choices b etween many dierent inheritance strategies The reective features of Smalltalk cannot aect the basic mechanisms of inheritance and so an arbitrary choice must b e made for multiple inheritance A language is describ ed in which the reective features of Smalltalk are extended so as to allow programmer dened inheritance strategies Intro duction The evaluation of a programming language expression e in a given context c may b e describ ed by the evaluation of a program p which takes a representation of e and c as input e is termed an ob jectlevel construct whilst p and the representations of e and c are termed metalevel constructs For illustration we use an op erator M which maps ob jectlevel constructs to metalevel constructs If the languages which are used for b oth the ob ject and metalevels are the same and causally connected then the language is reective Ob jectOriented Programming Languages OOPLs have interpretive mechanisms which are based up on classes ob ject creation message passing and inheritance Classes typically dene the lo cal state and op erations for ob jects which are their instances When a message is passed to an ob ject the op eration with the message name is invoked with resp ect to the lo cal state A class inherits from another class by including all the inherited storage and op eration denitions along with its own The metalevel of an OOPL describ es how to p erform inheritance message passing instance creation etc If the OOPL is reective then these mechanisms are describ ed in terms of messages which are sent to ob jects at the meta level Consider the ob jects at some base level B the ob jects and messages which describ e how to p erform creation of ob jects at B message passing at B etc are dened at level MB these ob jects are called classes A class at level MB is characterized by controlling the creation and subsequent b ehaviour of a collection of ob jects at level B The ob jects which are classes 2 at level MB are created and controlled by ob jects at level M B these ob jects are called 2 metaclasses A metaclass at level M B is characterized by controlling the creation and subsequent b ehaviour of classes at level MB coined the term golden braid to describ e the relationship b etween ob jects classes and metaclasses Of course since classes are ob jects then we can view the golden braid starting at 3 2 MB and ending at M B which reinterprets the metaclasses at level M B as classes n A feature of an OOPL is builtin at all levels when its b ehaviour is the same for M n Such features cannot b e extended and may b e said to b e intransigent An OOPL can b e reective whilst still having intransigent features an OOPL which has no intransigent features may b e said to b e ful ly reective Reective OOPLs include Smalltalk Lo ops CLOS KRS Ob jVLisp These languages dier in terms of the ways in which the golden braid is implemented and the extent to which it may b e used to aect the basic interpretive mechanisms of the resp ective languages This pap er describ es the reective p ower of Smalltalk identies an intransigent language feature send and prop oses a language extension which increases the reective p ower by including the feature into the metalevel x describ es a simple functional language which will b e used to implement three reective ob jectoriented systems which dier with resp ect to how expressive their reective features are x describ es a system called Abstract Smalltalk AS which is an implementation of the relevant features of the language Smalltalk AS exhibits single inheritance which is generalised to multiple inheritance in the system AS with Multiple Inheritance ASMI describ ed in x Both AS and ASMI have intransigent language features including ob ject representation and message passing which means that it is dicult to have multiple typ es of inheritance mechanism coexistsing in the same system This is particularly a drawback when the system exhibits multiple inheritance b ecause there are many orthogonal multiple inheritance schemes ASMI with Reective Send ASMIRS describ ed in x makes b oth ob ject representation and message passing a reective feature of the system This is shown to supp ort dierent typ es of multiple inheritance strategy within the same system Functional Representation The systems AS ASMI and ASMIRS are constructed using a simple functional language which following has b een enriched with data values op erators and evaluation rules which are characteristic of ob jectoriented programming languages The language has a call byvalue semantics and enriches the evaluation rules for the calculus with pattern matching currying rst class environments and up dateable lo cations The syntax of the language is divided into two the kernel syntax which is given a semantics using a state transition system based on the SECD machine and the sugared syntax which is given a semantics by translating into the kernel For more information ab out functional languages see and The sugared syntax is given b elow T let D D I E j F + + F I P E j meth I P E j F jF j P P j KP j N j S P I j + E I j N j S j P E j EE j EOE j if E then E else E j E E j E j E E + + E E j E where D j let D in E j case E of A end j op en E in E A P E j AA A program is a sequence of top level recursive denitions t T and expressions e E D is the syntax of declarations which may b e a simple value such as i or a functional declaration f F such as add x y x y Functional declarations may b e overloaded and may include metho ds b oth of which are describ ed in app endix A Patterns p P are used in binding p ositions to limit the domain of a function and to decomp ose the value which is supplied as an argument to the function by extracting subcomp onents and binding them to identiers A pattern may b e an identier i in which case the supplied value is b ound to i a wildcard in which case the supplied value is ignored a tuple p p in which case 1 n the supplied value must b e a tuple of the same length and the corresp onding subcomp onents must match against the subpatterns a constructor k K applied to a pattern p in which case the supplied value must b e constructed using k eg k v and v must match p or a constant numb er n N or string s S in which case the supplied value must b e the constant An expression e is an identier numb er or string a function p p p e which may 1 2 n b e curried and have patterns in the binding p ositions a prex application e e an inx 1 2 application e e where O denes a collection of inx op erators a conditional expression a 1 2 tuple a parenthesized expression a sequenced expression e e which is used to control side 1 2 eects a list expression e e where e constructs singleton lists and is the empty 1 n list a where or let expression b oth of which may have a sequence of declarations which are established in parallel a case expression case e in p e p e end where e 1 1 n n is evaluated and tested against the patterns in turn the rst pattern which matches will deconstruct the value of e p ossibly bind some identiers and evaluate the corresp onding expression an op en expression op en e in e where e pro duces an environment binding 1 2 1 identiers to values which is added to the current environment for the scop e of the evaluation of expression e 2 Environments are collections of asso ciations bindings b etween keys and values The op erational semantics of programming languages often
Recommended publications
  • Objects and Classes in Python Documentation Release 0.1
    Objects and classes in Python Documentation Release 0.1 Jonathan Fine Sep 27, 2017 Contents 1 Decorators 2 1.1 The decorator syntax.........................................2 1.2 Bound methods............................................3 1.3 staticmethod() .........................................3 1.4 classmethod() ..........................................3 1.5 The call() decorator.......................................4 1.6 Nesting decorators..........................................4 1.7 Class decorators before Python 2.6.................................5 2 Constructing classes 6 2.1 The empty class...........................................6 3 dict_from_class() 8 3.1 The __dict__ of the empty class...................................8 3.2 Is the doc-string part of the body?..................................9 3.3 Definition of dict_from_class() ...............................9 4 property_from_class() 10 4.1 About properties........................................... 10 4.2 Definition of property_from_class() ............................ 11 4.3 Using property_from_class() ................................ 11 4.4 Unwanted keys............................................ 11 5 Deconstructing classes 13 6 type(name, bases, dict) 14 6.1 Constructing the empty class..................................... 14 6.2 Constructing any class........................................ 15 6.3 Specifying __doc__, __name__ and __module__.......................... 15 7 Subclassing int 16 7.1 Mutable and immutable types.................................... 16 7.2
    [Show full text]
  • Csci 658-01: Software Language Engineering Python 3 Reflexive
    CSci 658-01: Software Language Engineering Python 3 Reflexive Metaprogramming Chapter 3 H. Conrad Cunningham 4 May 2018 Contents 3 Decorators and Metaclasses 2 3.1 Basic Function-Level Debugging . .2 3.1.1 Motivating example . .2 3.1.2 Abstraction Principle, staying DRY . .3 3.1.3 Function decorators . .3 3.1.4 Constructing a debug decorator . .4 3.1.5 Using the debug decorator . .6 3.1.6 Case study review . .7 3.1.7 Variations . .7 3.1.7.1 Logging . .7 3.1.7.2 Optional disable . .8 3.2 Extended Function-Level Debugging . .8 3.2.1 Motivating example . .8 3.2.2 Decorators with arguments . .9 3.2.3 Prefix decorator . .9 3.2.4 Reformulated prefix decorator . 10 3.3 Class-Level Debugging . 12 3.3.1 Motivating example . 12 3.3.2 Class-level debugger . 12 3.3.3 Variation: Attribute access debugging . 14 3.4 Class Hierarchy Debugging . 16 3.4.1 Motivating example . 16 3.4.2 Review of objects and types . 17 3.4.3 Class definition process . 18 3.4.4 Changing the metaclass . 20 3.4.5 Debugging using a metaclass . 21 3.4.6 Why metaclasses? . 22 3.5 Chapter Summary . 23 1 3.6 Exercises . 23 3.7 Acknowledgements . 23 3.8 References . 24 3.9 Terms and Concepts . 24 Copyright (C) 2018, H. Conrad Cunningham Professor of Computer and Information Science University of Mississippi 211 Weir Hall P.O. Box 1848 University, MS 38677 (662) 915-5358 Note: This chapter adapts David Beazley’s debugly example presentation from his Python 3 Metaprogramming tutorial at PyCon’2013 [Beazley 2013a].
    [Show full text]
  • The Use of UML for Software Requirements Expression and Management
    The Use of UML for Software Requirements Expression and Management Alex Murray Ken Clark Jet Propulsion Laboratory Jet Propulsion Laboratory California Institute of Technology California Institute of Technology Pasadena, CA 91109 Pasadena, CA 91109 818-354-0111 818-393-6258 [email protected] [email protected] Abstract— It is common practice to write English-language 1. INTRODUCTION ”shall” statements to embody detailed software requirements in aerospace software applications. This paper explores the This work is being performed as part of the engineering of use of the UML language as a replacement for the English the flight software for the Laser Ranging Interferometer (LRI) language for this purpose. Among the advantages offered by the of the Gravity Recovery and Climate Experiment (GRACE) Unified Modeling Language (UML) is a high degree of clarity Follow-On (F-O) mission. However, rather than use the real and precision in the expression of domain concepts as well as project’s model to illustrate our approach in this paper, we architecture and design. Can this quality of UML be exploited have developed a separate, ”toy” model for use here, because for the definition of software requirements? this makes it easier to avoid getting bogged down in project details, and instead to focus on the technical approach to While expressing logical behavior, interface characteristics, requirements expression and management that is the subject timeliness constraints, and other constraints on software using UML is commonly done and relatively straight-forward, achiev- of this paper. ing the additional aspects of the expression and management of software requirements that stakeholders expect, especially There is one exception to this choice: we will describe our traceability, is far less so.
    [Show full text]
  • Metaclasses: Generative C++
    Metaclasses: Generative C++ Document Number: P0707 R3 Date: 2018-02-11 Reply-to: Herb Sutter ([email protected]) Audience: SG7, EWG Contents 1 Overview .............................................................................................................................................................2 2 Language: Metaclasses .......................................................................................................................................7 3 Library: Example metaclasses .......................................................................................................................... 18 4 Applying metaclasses: Qt moc and C++/WinRT .............................................................................................. 35 5 Alternatives for sourcedefinition transform syntax .................................................................................... 41 6 Alternatives for applying the transform .......................................................................................................... 43 7 FAQs ................................................................................................................................................................. 46 8 Revision history ............................................................................................................................................... 51 Major changes in R3: Switched to function-style declaration syntax per SG7 direction in Albuquerque (old: $class M new: constexpr void M(meta::type target,
    [Show full text]
  • Meta-Class Features for Large-Scale Object Categorization on a Budget
    Meta-Class Features for Large-Scale Object Categorization on a Budget Alessandro Bergamo Lorenzo Torresani Dartmouth College Hanover, NH, U.S.A. faleb, [email protected] Abstract cation accuracy over a predefined set of classes, and without consideration of the computational costs of the recognition. In this paper we introduce a novel image descriptor en- We believe that these two assumptions do not meet the abling accurate object categorization even with linear mod- requirements of modern applications of large-scale object els. Akin to the popular attribute descriptors, our feature categorization. For example, test-recognition efficiency is a vector comprises the outputs of a set of classifiers evaluated fundamental requirement to be able to scale object classi- on the image. However, unlike traditional attributes which fication to Web photo repositories, such as Flickr, which represent hand-selected object classes and predefined vi- are growing at rates of several millions new photos per sual properties, our features are learned automatically and day. Furthermore, while a fixed set of object classifiers can correspond to “abstract” categories, which we name meta- be used to annotate pictures with a set of predefined tags, classes. Each meta-class is a super-category obtained by the interactive nature of searching and browsing large im- grouping a set of object classes such that, collectively, they age collections calls for the ability to allow users to define are easy to distinguish from other sets of categories. By us- their own personal query categories to be recognized and ing “learnability” of the meta-classes as criterion for fea- retrieved from the database, ideally in real-time.
    [Show full text]
  • Metaclass Functions: Generative C++
    Metaclass functions: Generative C++ Document Number: P0707 R4 Date: 2019-06-16 Reply-to: Herb Sutter ([email protected]) Audience: SG7, EWG Contents 1 Overview .............................................................................................................................................................2 2 Language: “Metaclass” functions .......................................................................................................................6 3 Library: Example metaclasses .......................................................................................................................... 18 4 Applying metaclasses: Qt moc and C++/WinRT .............................................................................................. 35 5 FAQs ................................................................................................................................................................. 41 R4: • Updated notes in §1.3 to track the current prototype, which now also has consteval support. • Added using metaclass function in the class body. Abstract The only way to make a language more powerful, but also make its programs simpler, is by abstraction: adding well-chosen abstractions that let programmers replace manual code patterns with saying directly what they mean. There are two major categories: Elevate coding patterns/idioms into new abstractions built into the language. For example, in current C++, range-for lets programmers directly declare “for each” loops with compiler support and enforcement.
    [Show full text]
  • On the Interaction of Object-Oriented Design Patterns and Programming
    On the Interaction of Object-Oriented Design Patterns and Programming Languages Gerald Baumgartner∗ Konstantin L¨aufer∗∗ Vincent F. Russo∗∗∗ ∗ Department of Computer and Information Science The Ohio State University 395 Dreese Lab., 2015 Neil Ave. Columbus, OH 43210–1277, USA [email protected] ∗∗ Department of Mathematical and Computer Sciences Loyola University Chicago 6525 N. Sheridan Rd. Chicago, IL 60626, USA [email protected] ∗∗∗ Lycos, Inc. 400–2 Totten Pond Rd. Waltham, MA 02154, USA [email protected] February 29, 1996 Abstract Design patterns are distilled from many real systems to catalog common programming practice. However, some object-oriented design patterns are distorted or overly complicated because of the lack of supporting programming language constructs or mechanisms. For this paper, we have analyzed several published design patterns looking for idiomatic ways of working around constraints of the implemen- tation language. From this analysis, we lay a groundwork of general-purpose language constructs and mechanisms that, if provided by a statically typed, object-oriented language, would better support the arXiv:1905.13674v1 [cs.PL] 31 May 2019 implementation of design patterns and, transitively, benefit the construction of many real systems. In particular, our catalog of language constructs includes subtyping separate from inheritance, lexically scoped closure objects independent of classes, and multimethod dispatch. The proposed constructs and mechanisms are not radically new, but rather are adopted from a variety of languages and programming language research and combined in a new, orthogonal manner. We argue that by describing design pat- terns in terms of the proposed constructs and mechanisms, pattern descriptions become simpler and, therefore, accessible to a larger number of language communities.
    [Show full text]
  • OMG Unified Modeling Languagetm (OMG UML), Infrastructure
    Date : August 2011 OMG Unified Modeling LanguageTM (OMG UML), Infrastructure Version 2.4.1 OMG Document Number: formal/2011-08-05 Standard document URL: http://www.omg.org/spec/UML/2.4.1/Infrastructure Associated Normative Machine-Readable Files: http://www.omg.org/spec/UML/20110701/Infrastucture.xmi http://www.omg.org/spec/UML/20110701/L0.xmi http://www.omg.org/spec/UML/20110701/LM.xmi http://www.omg.org/spec/UML/20110701/PrimitiveTypes.xmi Version 2.4.1 supersedes formal/2010-05-04. Copyright © 1997-2011 Object Management Group Copyright © 2009-2010 88Solutions Copyright © 2009-2010 Artisan Software Tools Copyright © 2001-2010 Adaptive Copyright © 2009-2010 Armstrong Process Group, Inc. Copyright © 2001-2010 Alcatel Copyright © 2001-2010 Borland Software Corporation Copyright © 2009-2010 Commissariat à l'Energie Atomique Copyright © 2001-2010 Computer Associates International, Inc. Copyright © 2009-2010 Computer Sciences Corporation Copyright © 2009-2010 European Aeronautic Defence and Space Company Copyright © 2001-2010 Fujitsu Copyright © 2001-2010 Hewlett-Packard Company Copyright © 2001-2010 I-Logix Inc. Copyright © 2001-2010 International Business Machines Corporation Copyright © 2001-2010 IONA Technologies Copyright © 2001-2010 Kabira Technologies, Inc. Copyright © 2009-2010 Lockheed Martin Copyright © 2001-2010 MEGA International Copyright © 2009-2010 Mentor Graphics Corporation Copyright © 2009-2010 Microsoft Corporation Copyright © 2009-2010 Model Driven Solutions Copyright © 2001-2010 Motorola, Inc. Copyright © 2009-2010 National
    [Show full text]
  • A Core Calculus of Metaclasses
    A Core Calculus of Metaclasses Sam Tobin-Hochstadt Eric Allen Northeastern University Sun Microsystems Laboratories [email protected] [email protected] Abstract see the problem, consider a system with a class Eagle and Metaclasses provide a useful mechanism for abstraction in an instance Harry. The static type system can ensure that object-oriented languages. But most languages that support any messages that Harry responds to are also understood by metaclasses impose severe restrictions on their use. Typi- any other instance of Eagle. cally, a metaclass is allowed to have only a single instance However, even in a language where classes can have static and all metaclasses are required to share a common super- methods, the desired relationships cannot be expressed. For class [6]. In addition, few languages that support metaclasses example, in such a language, we can write the expression include a static type system, and none include a type system Eagle.isEndangered() provided that Eagle has the ap- with nominal subtyping (i.e., subtyping as defined in lan- propriate static method. Such a method is appropriate for guages such as the JavaTM Programming Language or C#). any class that is a species. However, if Salmon is another To elucidate the structure of metaclasses and their rela- class in our system, our type system provides us no way of tionship with static types, we present a core calculus for a requiring that it also have an isEndangered method. This nominally typed object-oriented language with metaclasses is because we cannot classify both Salmon and Eagle, when and prove type soundness over this core.
    [Show full text]
  • The Gaudi Reflection Tool Crash Course
    SDLT Single File Template 1 4. Sept. 2001 Version/Issue: 2/1 European Laboratory for Particle Physics Laboratoire Européen pour la Physique des Particules CH-1211 Genève 23 - Suisse The Gaudi Reflection Tool Crash Course Document Version: 1 Document Date: 4. Sept. 2001 Document Status: Draft Document Author: Stefan Roiser Abstract 1 Introduction The Gaudi Reflection Tool is a model for the metarepresentation of C++ classes. This model has to be filled with the corresponding information to each class that shall be represented through this model. Ideally the writing of this information and filling of the model will be done during the creation of the real classes. Once the model is filled with information a pointer to the real class will be enough to enter this model and retrieve information about the real class. If there are any relations to other classes, and the information about these corresponding classes is also part of the metamodel one can jump to these classes and also retrieve information about them. So an introspection of C++ classes from an external point of view can be realised quite easily. 2 The Meta Model The struture of the Gaudi Reflection Model is divided into four parts. These four parts are represented by four C++-classes. The corepart is the class called MetaClass. Within this class everything relevant to the real object will be stored. This information includes the name, a description, the author, the list of methods, members and constructors of this class etc. This class is also the entrypoint to the MetaModel. Using the MetaClass function forName and the Template page 1 SDLT Single File Template 2 The Meta Model Version/Issue: 2/1 string of the type of the real class as an argument, a pointer to the corresponding instance of MetaClass will be returned.
    [Show full text]
  • Python 3 Metaprogramming Requirements
    Python 3 Metaprogramming David Beazley @dabeaz http://www.dabeaz.com Presented at PyCon'2013, Santa Clara, CA March 14, 2013 Copyright (C) 2013, http://www.dabeaz.com 1 Requirements • Python 3.3 or more recent • Don't even attempt on any earlier version • Support files: http://www.dabeaz.com/py3meta Copyright (C) 2013, http://www.dabeaz.com 2 Welcome! • An advanced tutorial on two topics • Python 3 • Metaprogramming • Honestly, can you have too much of either? • No! Copyright (C) 2013, http://www.dabeaz.com 3 Metaprogramming • In a nutshell: code that manipulates code • Common examples: • Decorators • Metaclasses • Descriptors • Essentially, it's doing things with code Copyright (C) 2013, http://www.dabeaz.com 4 Why Would You Care? • Extensively used in frameworks and libraries • Better understanding of how Python works • It's fun • It solves a practical problem Copyright (C) 2013, http://www.dabeaz.com 5 DRY Copyright (C) 2013, http://www.dabeaz.com 6 DRY Don't Repeat Yourself Copyright (C) 2013, http://www.dabeaz.com 7 DRY Don't Repeat Yourself Don't Repeat Yourself Copyright (C) 2013, http://www.dabeaz.com 8 Don't Repeat Yourself • Highly repetitive code sucks • Tedious to write • Hard to read • Difficult to modify Copyright (C) 2013, http://www.dabeaz.com 9 This Tutorial • A modern journey of metaprogramming • Highlight unique aspects of Python 3 • Explode your brain Copyright (C) 2013, http://www.dabeaz.com 10 Target Audience • Framework/library builders • Anyone who wants to know how things work • Programmers wishing to increase "job security" Copyright (C) 2013, http://www.dabeaz.com 11 Reading • Tutorial loosely based on content in "Python Cookbook, 3rd Ed." • Published May, 2013 • You'll find even more information in the book Copyright (C) 2013, http://www.dabeaz.com 12 Preliminaries Copyright (C) 2013, http://www.dabeaz.com 13 Basic Building Blocks statement1 def func(args): statement2 statement1 statement3 statement2 ..
    [Show full text]
  • 7. Understanding Classes and Metaclasses ST — Understanding Classes and Metaclasses Roadmap
    7. Understanding Classes and Metaclasses ST — Understanding Classes and Metaclasses Roadmap > Metaclasses in 7 points > Indexed Classes > Class Instance Variables > Class Variables > Pool Dictionaries Selected material courtesy Stéphane Ducasse © Oscar Nierstrasz 7.2 ST — Understanding Classes and Metaclasses Roadmap > Metaclasses in 7 points > Indexed Classes > Class Instance Variables > Class Variables > Pool Dictionaries © Oscar Nierstrasz 7.3 ST — Understanding Classes and Metaclasses Metaclasses in 7 points 1. Every object is an instance of a class 2. Every class eventually inherits from Object 3. Every class is an instance of a metaclass 4. The metaclass hierarchy parallels the class hierarchy 5. Every metaclass inherits from Class and Behavior 6. Every metaclass is an instance of Metaclass 7. The metaclass of Metaclass is an instance of Metaclass Adapted from Goldberg & Robson, Smalltalk-80 — The Language © Oscar Nierstrasz 7.4 ST — Understanding Classes and Metaclasses Metaclasses in 7 points 1. Every object is an instance of a class 2. Every class eventually inherits from Object 3. Every class is an instance of a metaclass 4. The metaclass hierarchy parallels the class hierarchy 5. Every metaclass inherits from Class and Behavior 6. Every metaclass is an instance of Metaclass 7. The metaclass of Metaclass is an instance of Metaclass © Oscar Nierstrasz 7.5 ST — Understanding Classes and Metaclasses 1. Every object is an instance of a class © Oscar Nierstrasz 7.6 ST — Understanding Classes and Metaclasses Metaclasses in 7 points 1. Every object is an instance of a class 2. Every class eventually inherits from Object 3. Every class is an instance of a metaclass 4.
    [Show full text]