Knowledge

Metaclass

Source đź“ť

1520: 1529: 1024: 1765: 1032: 1657: 963: 128: 66: 25: 1715: 1777:
Like Smalltalk, in Objective-C, class methods are simply methods called on the class object, hence a class's class methods must be defined as instance methods in its metaclass. Because different classes can have different sets of class methods, each class must have its own separate metaclass. Classes
1768:
Diagram of the inheritance and instance relationships between classes and metaclasses in Objective-C. Note that Objective-C has multiple root classes; each root class would have a separate hierarchy. This diagram only shows the hierarchy for an example root class NSObject. Each other root class would
1051:
system, which means that every object has a class that defines the structure of that object (i.e. the instance variables the object has) and the messages an object understands. Together this implies that a class in Smalltalk is an object and that, therefore a class needs to be an instance of a class
1472:
The following diagrams show a sample core structure of Smalltalk-80 and Ruby in comparison. In both languages, the structure consists of a built-in part which contains the circular objects (i.e. objects that appear in a cycle formed by a combination of blue or green links) and a user-part which has
1773:
Metaclasses in Objective-C are almost the same as those in Smalltalk-80—not surprising since Objective-C borrows a lot from Smalltalk. Like Smalltalk, in Objective-C, the instance variables and methods are defined by an object's class. A class is an object, hence it is an instance of a metaclass.
1816:
Since metaclass objects do not behave differently (you cannot add class methods for a metaclass, so metaclass objects all have the same methods), they are all instances of the same class—the metaclass of the root class (unlike Smalltalk). Thus, the metaclass of the root class is an instance of
1800:
Because class methods are inherited through inheritance, like Smalltalk, metaclasses must follow an inheritance scheme paralleling that of classes (e.g. if class A's parent class is class B, then A's metaclass's parent class is B's metaclass), except that of the root class.
1812:
framework) itself. This ensures that all class objects are ultimately instances of the root class, so that you can use the instance methods of the root class, usually useful utility methods for objects, on class objects themselves.
1588:
are the only metaclasses in Ruby. This seems to contradict the correspondence between Ruby and Smalltalk, since in Smalltalk-80, every class has its own metaclass. The discrepancy is based on the disagreement between the
1452:
Note in particular the correspondence between Smalltalk's implicit metaclasses and Ruby's eigenclasses of classes. The Ruby eigenclass model makes the concept of implicit metaclasses fully uniform: every object
1489:. Green links show the child→parent relation of inheritance (with the implicit upward direction), blue links show the complementary member→container relation of instantiation (a blue link from 270:, which are the rules that determine interactions among objects, classes, and metaclasses. Metaclasses are utilized to automate code generation and to enhance framework development. 262:
support the concept of metaclasses. For those that do, the extent of control metaclasses have over class behaviors varies. Metaclasses are often implemented by treating classes as
258:
are classes themselves. Unlike ordinary classes, which define the behaviors of objects, metaclasses specify the behaviors of classes and their instances. Not all object-oriented
1075:. Note the blank in the name of the metaclass. The name of the metaclass is the Smalltalk expression that, when evaluated, results in the metaclass object. Thus evaluating 1898: 2247: 1984: 544:
is accessed. In languages without metaclasses, these details are defined by the language specification and can't be overridden. In Python, the metaclass -
1124:. Note that, so far, the metaclass inheritance chain exactly follows that of the class inheritance chain. But the metaclass chain extends further because 1469:. The "higher order" eigenclasses usually exist purely conceptually – they do not contain any methods or store any (other) data in most Ruby programs. 1238:
does not show metaclasses as separate classes. Instead the class browser allows to edit the class together with its metaclass at the same time.
1519: 1258:
is the base of the metaclasses that provides common methods for all classes (though it is not a metaclass itself); "a class" is something like
1147:. To allow classes to have their own methods and their own instance variables (called class instance variables and should not be confused with 575:. It is possible to eliminate some of this redundancy using a custom metaclass. In Python, a metaclass is most easily defined as a subclass of 2063: 1817:
itself. The reason for this is that all metaclasses inherit from root class; hence, they must inherit the class methods of the root class.
1166:
Since there is no requirement that metaclasses behave differently from each other, all metaclasses are instances of only one class called
1910: 2417: 1918: 1902: 2788: 2422: 1926: 2412: 2407: 1101:
actually belong to the metaclass, just as instance methods actually belong to the class. When a message is sent to the object
3182: 2851: 2160: 2395: 2296: 1733: 1725: 1528: 1789:
There are no names for the metaclasses; however, a pointer to any class object can be referred to with the generic type
192: 1241:
The names of classes in the metaclass hierarchy are easily confused with the concepts of the same name. For instance:
164: 2573: 2029: 1751: 1696: 1010: 229: 211: 109: 52: 2254: 992: 736:
This metaclass only overrides object creation. All other aspects of class and object behavior are still handled by
266:, making a metaclass an object that creates and manages these classes. Each programming language adheres to its own 91: 2546: 1600:
coincides on terminal objects, it differs in the restriction to classes. As already mentioned above, for a class
255: 171: 2663: 2468: 2400: 2362: 1942: 1678: 988: 149: 76: 2103: 1979: 1862: 1852: 1842: 1248:
is the base class that provides common methods for all objects; "an object" is an integer, or a widget, or a
1190: 279: 2563: 2493: 2341: 178: 2214: 2818: 2453: 1876: 1109:. If it is not found it proceeds up the superclass chain, stopping at Object whether it is found or not. 243: 2441: 1674: 984: 145: 38: 2230: 160: 2844: 2751: 2703: 2615: 2593: 2588: 2516: 2382: 2336: 1946: 1837: 1140: 1044: 2090: 2087: 2889: 2625: 2289: 1994: 1292: 973: 747:
can be rewritten to use this metaclass. In Python 3 this is done by providing a "keyword argument"
251: 1035:
Diagram of the inheritance and instance relationships between classes and metaclasses in Smalltalk
2778: 2693: 2071: 1667: 1501:). Gray nodes display the eigenclasses (resp. implicit metaclasses in the case of Smalltalk-80). 1048: 977: 138: 87: 2060: 3141: 2975: 2521: 2377: 2331: 2970: 2511: 2486: 2135: 1281: 259: 2837: 2313: 2075: 1826: 1328: 8: 2783: 2761: 2688: 2541: 2533: 2282: 1194: 267: 263: 1804:
Unlike Smalltalk, the metaclass of the root class inherits from the root class (usually
2913: 2766: 2746: 2698: 2673: 2458: 2427: 2150: 1974: 185: 1335:
class, and (un)redefining the class-of map. The change can be schematized as follows:
1204:
The superclass hierarchy for metaclasses parallels that for classes, except for class
1143:
all classes have were the same, in particular the method to create new objects, i.e.,
3047: 3042: 2653: 2583: 2558: 2372: 2367: 2156: 2108: 2025: 1929:. Several of these languages date from the early 1990s and are of academic interest. 1580:
is disallowed. Following the standard definition of metaclasses we can conclude that
1160: 3062: 2879: 2798: 2683: 2481: 83: 3131: 3106: 3087: 3007: 2803: 2668: 2620: 2553: 2067: 1989: 1964: 1538: 1223: 16:
A metaclass describes commen behaviour for classes, like a class does for objects
1545:
object can have its eigenclass evaluated (allocated) as a consequence of adding
3126: 3116: 3111: 3101: 3057: 3027: 2990: 2980: 2756: 2578: 2568: 2476: 1999: 1303: 1148: 873:
can be instantiated as usual, but can contain any number of keyword arguments:
44: 559:
The above example contains some redundant code to do with the four attributes
552:'s behavior. They can be overridden by using a different metaclass instead of 3176: 3077: 3052: 3032: 3022: 3002: 2995: 2985: 2965: 2933: 2918: 2901: 2896: 2874: 2860: 2678: 2190: 2176: 1846: 1235: 3096: 3017: 2960: 2938: 2635: 2610: 1959: 1871: 1098: 1023: 1497:
that is the start point for the method lookup when a method is invoked on
524:
class, shown above, does not include such details as the size in bytes of
3151: 3146: 3136: 3082: 3037: 2950: 2813: 2808: 2658: 2605: 2432: 2226: 1906: 1857: 1833: 1809: 528:
objects, their binary layout in memory, how they are allocated, that the
1778:
and metaclasses are always created as a pair: the runtime has functions
1764: 536:
is created, and so on. These details come into play not only when a new
3156: 3121: 3067: 2955: 2928: 2906: 2718: 2713: 2630: 2598: 2503: 2446: 1969: 1681: in this section. Unsourced material may be challenged and removed. 1560:, the class of every class (and of every eigenclass) is constantly the 1031: 3161: 3072: 3012: 2793: 2728: 2723: 2390: 2346: 2305: 1889:(proposed for a possible inclusion in future version of the standard) 1881: 1576:
are the only classes that have classes as instances. Subclassing of
1327:
Ruby purifies the Smalltalk-80 concept of metaclasses by introducing
1296: 1234:, which points to its conjoined class. Note that the usual Smalltalk 1040: 810:"""Return a description of this car.""" 450:"""Return a description of this car.""" 1656: 1312:
Metaclass - initializing class variables, instance creation messages
962: 127: 94:. Statements consisting only of original research should be removed. 2943: 2923: 2708: 2113: 1914: 1894: 1288:
Object - default behavior common to all objects, like class access
1280:
Four classes provide the facilities to describe new classes. Their
1932: 2019: 1893:
Some less widespread languages that support metaclasses include
1936: 1309:
Class - similar, more comprehensive, facilities to superclasses
1067:
is again an object and as such an instance of the metaclass of
2274: 1922: 1886: 2177:"Object Membership: The Core Structure of Object Technology" 1786:
to create and register class-metaclass pairs, respectively.
2326: 1867: 1503: 1593:
introspection method in Ruby and Smalltalk. While the map
632:"""Create a new instance.""" 2321: 1284:(from Object), and the main facilities they provide are: 1135:
In early Smalltalks, there was only one metaclass called
540:
object is created, but also each time any attribute of a
2829: 2248:"An implementation of mixins in Java using metaclasses" 2215:
Cocoa with Love: What is a meta-class in Objective-C?
2136:"The Ruby Object Model: Comparison with Smalltalk-80" 1027:
The Smalltalk-80 metaclass hierarchy as a UML diagram
635:# First, create the object in the normal default way. 1537:
The diagram on the right also provides a picture of
1556:According to the Ruby's introspection method named 286:is a metaclass. Consider this simple Python class: 152:. Unsourced material may be challenged and removed. 1159:. This means that each metaclass is effectively a 1820: 1201:, which describes the general nature of classes. 671:# Additionally, set attributes on the new object. 3174: 2148: 2845: 2290: 1825:The following are some of the most prominent 1226:, classes and metaclasses are born together. 1276:provides common methods for all metaclasses. 2059:IBM Metaclass programming in Python, parts 1337: 1132:. All metaclasses are subclasses of Class. 1091:which returns the name of the metaclass of 991:. Unsourced material may be challenged and 532:method is automatically called each time a 53:Learn how and when to remove these messages 2852: 2838: 2297: 2283: 2104:"A Primer on Python Metaclass Programming" 1151:), Smalltalk-80 introduced for each class 2044: 2020:Ira R. Forman and Scott Danforth (1999). 1797:being used for a pointer to any object). 1752:Learn how and when to remove this message 1697:Learn how and when to remove this message 1011:Learn how and when to remove this message 230:Learn how and when to remove this message 212:Learn how and when to remove this message 110:Learn how and when to remove this message 2086:Artima Forum: Metaclasses in Python 3.0 1763: 1493:points to the least actual container of 1120:and proceeds up the superclass chain to 1030: 1022: 2225: 2101: 1870:, via the metaclass pragma, as well as 1637:– which evaluates to the eigenclass of 3175: 1465:, which is one meta-level higher than 1105:, the search for the method starts in 2833: 2278: 1299:methods and creating/running objects 1185:In Smalltalk-80, every class (except 1708: 1679:adding citations to reliable sources 1650: 1457:has its own meta-object, called the 1306:) - class/variable naming, comments 1208:. ALL metaclasses are subclasses of 1178:which again is an instance of class 1116:the search for the method starts in 1087:(one can confirm this by evaluating 1079:results in the metaclass object for 989:adding citations to reliable sources 956: 150:adding citations to reliable sources 121: 59: 18: 13: 1935:, an object-oriented extension of 1724:tone or style may not reflect the 952: 14: 3194: 1646: 1217:Object class superclass == Class. 273: 34:This article has multiple issues. 1949:(UML) both support metaclasses. 1734:guide to writing better articles 1713: 1655: 1527: 1518: 961: 126: 64: 23: 2240: 2219: 2208: 2049:. Birmingham: Packt Publishing. 1666:needs additional citations for 1623:is a class then the expression 1473:four explicit objects: classes 1047:. Additionally, Smalltalk is a 137:needs additional citations for 42:or discuss these issues on the 2304: 2183: 2169: 2142: 2128: 2095: 2080: 2053: 2038: 2013: 1943:Resource Description Framework 1821:Support in languages and tools 1: 2363:Arbitrary-precision or bignum 2006: 1939:, also supports metaclasses. 1541:of eigenclasses in Ruby. The 3183:Class (computer programming) 1059:is an instance of the class 1055:As an example, a car object 548:- controls these details of 7: 2047:Metaprogramming with Python 2045:AloorRavi, Sulekha (2022). 2022:Putting Metaclasses to Work 1952: 244:object-oriented programming 90:the claims made and adding 10: 3201: 1829:that support metaclasses. 1630:corresponds to the Ruby's 1322: 1112:When a message is sent to 2867: 2859: 2737: 2704:Strongly typed identifier 2646: 2532: 2502: 2467: 2355: 2312: 1947:Unified Modeling Language 1769:have a similar hierarchy. 1411: 1365: 1230:has an instance variable 751:to the class definition: 520:. The source code of the 516:itself is an instance of 1995:Metaclass (Semantic Web) 1784:objc_registerClassPair() 1780:objc_allocateClassPair() 1613:evaluates constantly to 1139:. This implied that the 875: 753: 725:# Return the new object. 581: 288: 2779:Parametric polymorphism 2155:. Pragmatic Bookshelf. 2149:Paolo Perrotta (2010). 1845:and other versions of 1770: 1617:. In Smalltalk-80, if 1606:, the Ruby expression 1197:of all metaclasses is 1036: 1028: 1827:programming languages 1793:(similar to the type 1767: 1481:and terminal objects 1282:inheritance hierarchy 1063:. In turn, the class 1034: 1026: 869:The resulting object 260:programming languages 2152:Metaprogramming Ruby 2000:What Is a Metaclass? 1675:improve this article 1155:their own metaclass 1052:(called metaclass). 985:improve this section 282:, the builtin class 264:first-class citizens 146:improve this article 2868:Domains and methods 2784:Primitive data type 2689:Recursive data type 2542:Algebraic data type 2418:Quadruple precision 1390: 1344: 1291:Behavior - minimum 1195:abstract superclass 1170:. The metaclass of 1128:is the subclass of 1043:, everything is an 268:metaobject protocol 2914:Meta-communication 2747:Abstract data type 2428:Extended precision 2387:Reduced precision 2066:2008-09-03 at the 2024:. Addison-Wesley. 1975:Kind (type theory) 1771: 1564:class (denoted by 1388: 1342: 1302:ClassDescription ( 1037: 1029: 75:possibly contains 3170: 3169: 3048:Meta-organization 3043:Meta-optimization 2827: 2826: 2559:Associative array 2423:Octuple precision 2162:978-1-934356-47-0 2116:on April 30, 2003 1762: 1761: 1754: 1728:used on Knowledge 1726:encyclopedic tone 1707: 1706: 1699: 1568:in the diagram). 1547:singleton methods 1535: 1534: 1450: 1449: 1446: 1445: 1381: 1380: 1021: 1020: 1013: 777:AttributeInitType 587:AttributeInitType 240: 239: 232: 222: 221: 214: 196: 120: 119: 112: 77:original research 57: 3190: 3063:Metaepistemology 2880:Metabibliography 2854: 2847: 2840: 2831: 2830: 2799:Type constructor 2684:Opaque data type 2616:Record or Struct 2413:Double precision 2408:Single precision 2299: 2292: 2285: 2276: 2275: 2269: 2268: 2266: 2265: 2259: 2253:. Archived from 2252: 2244: 2238: 2237: 2235: 2223: 2217: 2212: 2206: 2205: 2203: 2201: 2187: 2181: 2180: 2173: 2167: 2166: 2146: 2140: 2139: 2132: 2126: 2125: 2123: 2121: 2112:. Archived from 2099: 2093: 2084: 2078: 2057: 2051: 2050: 2042: 2036: 2035: 2017: 1849:influenced by it 1807: 1796: 1792: 1785: 1781: 1757: 1750: 1746: 1743: 1737: 1736:for suggestions. 1732:See Knowledge's 1717: 1716: 1709: 1702: 1695: 1691: 1688: 1682: 1659: 1651: 1642: 1636: 1635:.singleton_class 1629: 1622: 1616: 1612: 1605: 1599: 1592: 1587: 1583: 1579: 1575: 1571: 1567: 1563: 1559: 1552: 1544: 1531: 1522: 1504: 1488: 1484: 1480: 1476: 1441: 1439:terminal objects 1421: 1408: 1397: 1391: 1387: 1362: 1351: 1345: 1341: 1338: 1334: 1275: 1269: 1265: 1261: 1257: 1251: 1247: 1233: 1229: 1218: 1211: 1207: 1200: 1188: 1181: 1177: 1173: 1169: 1158: 1154: 1146: 1138: 1131: 1127: 1123: 1119: 1115: 1108: 1104: 1094: 1090: 1086: 1082: 1078: 1074: 1070: 1066: 1062: 1058: 1016: 1009: 1005: 1002: 996: 965: 957: 948: 945: 944:'Hybrid' 942: 939: 936: 933: 930: 927: 924: 921: 918: 915: 912: 909: 906: 903: 900: 897: 896:'Toyota' 894: 891: 888: 885: 882: 879: 872: 865: 862: 859: 856: 853: 850: 847: 844: 841: 838: 835: 832: 829: 826: 823: 820: 817: 814: 811: 808: 805: 802: 799: 796: 793: 790: 787: 784: 781: 778: 775: 772: 769: 766: 763: 760: 757: 750: 746: 739: 732: 729: 726: 723: 720: 717: 714: 711: 708: 705: 702: 699: 696: 693: 690: 687: 684: 681: 678: 675: 672: 669: 666: 663: 660: 657: 654: 651: 648: 645: 642: 639: 636: 633: 630: 627: 624: 621: 618: 615: 612: 609: 606: 603: 600: 597: 594: 591: 588: 585: 578: 574: 570: 566: 562: 555: 551: 547: 543: 539: 535: 531: 527: 523: 519: 515: 508: 505: 502: 499: 496: 493: 490: 487: 484: 481: 478: 475: 472: 469: 466: 463: 460: 457: 454: 451: 448: 445: 442: 439: 436: 433: 430: 427: 424: 421: 418: 415: 412: 409: 406: 403: 400: 397: 394: 391: 388: 385: 382: 379: 376: 373: 370: 367: 364: 361: 358: 355: 352: 349: 346: 343: 340: 337: 334: 331: 328: 325: 322: 319: 316: 313: 310: 307: 304: 301: 298: 295: 292: 285: 235: 228: 217: 210: 206: 203: 197: 195: 154: 130: 122: 115: 108: 104: 101: 95: 92:inline citations 68: 67: 60: 49: 27: 26: 19: 3200: 3199: 3193: 3192: 3191: 3189: 3188: 3187: 3173: 3172: 3171: 3166: 3132:Meta-regulation 3107:Metaprogramming 3088:Metametaphysics 3008:Metamathematics 2863: 2858: 2828: 2823: 2804:Type conversion 2739: 2733: 2669:Enumerated type 2642: 2528: 2522:null-terminated 2498: 2463: 2351: 2308: 2303: 2273: 2272: 2263: 2261: 2257: 2250: 2246: 2245: 2241: 2233: 2224: 2220: 2213: 2209: 2199: 2197: 2189: 2188: 2184: 2175: 2174: 2170: 2163: 2147: 2143: 2134: 2133: 2129: 2119: 2117: 2100: 2096: 2085: 2081: 2068:Wayback Machine 2058: 2054: 2043: 2039: 2032: 2018: 2014: 2009: 2004: 1990:Adapter pattern 1965:Metaprogramming 1955: 1823: 1805: 1794: 1790: 1783: 1779: 1758: 1747: 1741: 1738: 1731: 1722:This section's 1718: 1714: 1703: 1692: 1686: 1683: 1672: 1660: 1649: 1638: 1631: 1624: 1618: 1614: 1607: 1601: 1597: 1590: 1585: 1581: 1577: 1573: 1569: 1565: 1561: 1557: 1550: 1542: 1539:lazy evaluation 1486: 1482: 1478: 1474: 1442: 1438: 1437:Eigenclasses of 1435: 1431: 1429: 1422: 1418: 1416: 1413: 1409: 1405: 1404:Eigenclasses of 1402: 1398: 1395: 1375: 1373: 1363: 1359: 1356: 1352: 1349: 1332: 1331:, removing the 1325: 1273: 1267: 1263: 1259: 1255: 1249: 1245: 1231: 1227: 1224:conjoined twins 1216: 1209: 1205: 1198: 1186: 1179: 1176:Metaclass class 1175: 1171: 1167: 1156: 1152: 1149:class variables 1144: 1136: 1129: 1125: 1121: 1117: 1113: 1106: 1102: 1092: 1088: 1084: 1080: 1076: 1072: 1068: 1064: 1060: 1056: 1017: 1006: 1000: 997: 982: 966: 955: 953:In Smalltalk-80 950: 949: 946: 943: 940: 937: 934: 932:'Green' 931: 928: 925: 922: 919: 916: 913: 910: 908:'Prius' 907: 904: 901: 898: 895: 892: 889: 886: 883: 880: 877: 870: 867: 866: 863: 860: 857: 854: 851: 848: 845: 842: 839: 836: 833: 830: 827: 824: 821: 818: 815: 812: 809: 806: 803: 800: 797: 794: 791: 788: 785: 782: 779: 776: 773: 770: 767: 764: 761: 758: 755: 748: 744: 737: 734: 733: 730: 727: 724: 721: 718: 715: 712: 709: 706: 703: 700: 697: 694: 691: 688: 685: 682: 679: 676: 673: 670: 667: 664: 661: 658: 655: 652: 649: 646: 643: 640: 637: 634: 631: 628: 625: 622: 619: 616: 613: 610: 607: 604: 601: 598: 595: 592: 589: 586: 583: 576: 572: 568: 564: 560: 553: 549: 545: 541: 537: 533: 529: 525: 521: 517: 513: 510: 509: 506: 503: 500: 497: 494: 491: 488: 485: 482: 479: 476: 473: 470: 467: 464: 461: 458: 455: 452: 449: 446: 443: 440: 437: 434: 431: 428: 425: 422: 419: 416: 413: 410: 407: 404: 401: 398: 395: 392: 389: 386: 383: 380: 377: 374: 371: 368: 365: 362: 359: 356: 353: 350: 347: 344: 341: 338: 335: 332: 329: 326: 323: 320: 317: 314: 311: 308: 305: 302: 299: 296: 293: 290: 283: 276: 236: 225: 224: 223: 218: 207: 201: 198: 155: 153: 143: 131: 116: 105: 99: 96: 81: 69: 65: 28: 24: 17: 12: 11: 5: 3198: 3197: 3186: 3185: 3168: 3167: 3165: 3164: 3159: 3154: 3149: 3144: 3139: 3134: 3129: 3127:Meta-reference 3124: 3119: 3117:Metapsychology 3114: 3112:Metapsychiatry 3109: 3104: 3102:Metapopulation 3099: 3094: 3093: 3092: 3091: 3090: 3080: 3075: 3070: 3065: 3058:Metaphilosophy 3055: 3050: 3045: 3040: 3035: 3030: 3028:Metamotivation 3025: 3020: 3015: 3010: 3005: 3000: 2999: 2998: 2993: 2991:Metapragmatics 2983: 2981:Meta-knowledge 2978: 2973: 2968: 2963: 2958: 2953: 2948: 2947: 2946: 2936: 2931: 2926: 2921: 2916: 2911: 2910: 2909: 2904: 2894: 2893: 2892: 2882: 2877: 2871: 2869: 2865: 2864: 2857: 2856: 2849: 2842: 2834: 2825: 2824: 2822: 2821: 2816: 2811: 2806: 2801: 2796: 2791: 2786: 2781: 2776: 2775: 2774: 2764: 2759: 2757:Data structure 2754: 2749: 2743: 2741: 2735: 2734: 2732: 2731: 2726: 2721: 2716: 2711: 2706: 2701: 2696: 2691: 2686: 2681: 2676: 2671: 2666: 2661: 2656: 2650: 2648: 2644: 2643: 2641: 2640: 2639: 2638: 2628: 2623: 2618: 2613: 2608: 2603: 2602: 2601: 2591: 2586: 2581: 2576: 2571: 2566: 2561: 2556: 2551: 2550: 2549: 2538: 2536: 2530: 2529: 2527: 2526: 2525: 2524: 2514: 2508: 2506: 2500: 2499: 2497: 2496: 2491: 2490: 2489: 2484: 2473: 2471: 2465: 2464: 2462: 2461: 2456: 2451: 2450: 2449: 2439: 2438: 2437: 2436: 2435: 2425: 2420: 2415: 2410: 2405: 2404: 2403: 2398: 2396:Half precision 2393: 2383:Floating point 2380: 2375: 2370: 2365: 2359: 2357: 2353: 2352: 2350: 2349: 2344: 2339: 2334: 2329: 2324: 2318: 2316: 2310: 2309: 2302: 2301: 2294: 2287: 2279: 2271: 2270: 2239: 2218: 2207: 2182: 2168: 2161: 2141: 2127: 2094: 2079: 2052: 2037: 2030: 2011: 2010: 2008: 2005: 2003: 2002: 1997: 1992: 1987: 1982: 1977: 1972: 1967: 1962: 1956: 1954: 1951: 1891: 1890: 1884: 1879: 1874: 1865: 1860: 1855: 1850: 1840: 1822: 1819: 1760: 1759: 1742:September 2013 1721: 1719: 1712: 1705: 1704: 1663: 1661: 1654: 1648: 1647:In Objective-C 1645: 1533: 1532: 1525: 1523: 1515: 1514: 1511: 1508: 1448: 1447: 1444: 1443: 1434: 1432: 1427: 1424: 1423: 1412: 1410: 1401: 1399: 1394: 1385: 1382: 1379: 1378: 1376: 1371: 1368: 1367: 1364: 1355: 1353: 1348: 1324: 1321: 1320: 1319: 1318: 1317: 1316: 1315: 1314: 1313: 1310: 1304:abstract class 1278: 1277: 1271: 1253: 1220: 1219: 1212:, therefore: 1089:Car class name 1083:whose name is 1019: 1018: 969: 967: 960: 954: 951: 876: 754: 743:Now the class 582: 289: 275: 274:Python example 272: 238: 237: 220: 219: 202:September 2013 134: 132: 125: 118: 117: 100:September 2013 72: 70: 63: 58: 32: 31: 29: 22: 15: 9: 6: 4: 3: 2: 3196: 3195: 3184: 3181: 3180: 3178: 3163: 3160: 3158: 3155: 3153: 3150: 3148: 3145: 3143: 3142:Metasociology 3140: 3138: 3135: 3133: 3130: 3128: 3125: 3123: 3120: 3118: 3115: 3113: 3110: 3108: 3105: 3103: 3100: 3098: 3095: 3089: 3086: 3085: 3084: 3081: 3079: 3078:Meta-ontology 3076: 3074: 3071: 3069: 3066: 3064: 3061: 3060: 3059: 3056: 3054: 3053:Metaphenomics 3051: 3049: 3046: 3044: 3041: 3039: 3036: 3034: 3033:Metanarrative 3031: 3029: 3026: 3024: 3023:Metamodernism 3021: 3019: 3016: 3014: 3011: 3009: 3006: 3004: 3003:Metamaterials 3001: 2997: 2996:Metasemantics 2994: 2992: 2989: 2988: 2987: 2986:Meta-language 2984: 2982: 2979: 2977: 2974: 2972: 2969: 2967: 2966:Metaheuristic 2964: 2962: 2959: 2957: 2954: 2952: 2949: 2945: 2942: 2941: 2940: 2937: 2935: 2934:Metadiscourse 2932: 2930: 2927: 2925: 2922: 2920: 2919:Metacomputing 2917: 2915: 2912: 2908: 2905: 2903: 2902:Meta-learning 2900: 2899: 2898: 2897:Metacognition 2895: 2891: 2888: 2887: 2886: 2883: 2881: 2878: 2876: 2875:Meta-analysis 2873: 2872: 2870: 2866: 2862: 2855: 2850: 2848: 2843: 2841: 2836: 2835: 2832: 2820: 2817: 2815: 2812: 2810: 2807: 2805: 2802: 2800: 2797: 2795: 2792: 2790: 2787: 2785: 2782: 2780: 2777: 2773: 2770: 2769: 2768: 2765: 2763: 2760: 2758: 2755: 2753: 2750: 2748: 2745: 2744: 2742: 2736: 2730: 2727: 2725: 2722: 2720: 2717: 2715: 2712: 2710: 2707: 2705: 2702: 2700: 2697: 2695: 2692: 2690: 2687: 2685: 2682: 2680: 2679:Function type 2677: 2675: 2672: 2670: 2667: 2665: 2662: 2660: 2657: 2655: 2652: 2651: 2649: 2645: 2637: 2634: 2633: 2632: 2629: 2627: 2624: 2622: 2619: 2617: 2614: 2612: 2609: 2607: 2604: 2600: 2597: 2596: 2595: 2592: 2590: 2587: 2585: 2582: 2580: 2577: 2575: 2572: 2570: 2567: 2565: 2562: 2560: 2557: 2555: 2552: 2548: 2545: 2544: 2543: 2540: 2539: 2537: 2535: 2531: 2523: 2520: 2519: 2518: 2515: 2513: 2510: 2509: 2507: 2505: 2501: 2495: 2492: 2488: 2485: 2483: 2480: 2479: 2478: 2475: 2474: 2472: 2470: 2466: 2460: 2457: 2455: 2452: 2448: 2445: 2444: 2443: 2440: 2434: 2431: 2430: 2429: 2426: 2424: 2421: 2419: 2416: 2414: 2411: 2409: 2406: 2402: 2399: 2397: 2394: 2392: 2389: 2388: 2386: 2385: 2384: 2381: 2379: 2376: 2374: 2371: 2369: 2366: 2364: 2361: 2360: 2358: 2354: 2348: 2345: 2343: 2340: 2338: 2335: 2333: 2330: 2328: 2325: 2323: 2320: 2319: 2317: 2315: 2314:Uninterpreted 2311: 2307: 2300: 2295: 2293: 2288: 2286: 2281: 2280: 2277: 2260:on 2007-10-16 2256: 2249: 2243: 2232: 2231:"Metaclasses" 2228: 2222: 2216: 2211: 2196: 2192: 2186: 2178: 2172: 2164: 2158: 2154: 2153: 2145: 2137: 2131: 2115: 2111: 2110: 2105: 2102:David Mertz. 2098: 2092: 2091:(part 2 of 2) 2089: 2088:(part 1 of 2) 2083: 2077: 2073: 2069: 2065: 2062: 2056: 2048: 2041: 2033: 2031:0-201-43305-2 2027: 2023: 2016: 2012: 2001: 1998: 1996: 1993: 1991: 1988: 1986: 1983: 1981: 1978: 1976: 1973: 1971: 1968: 1966: 1963: 1961: 1958: 1957: 1950: 1948: 1944: 1940: 1938: 1934: 1930: 1928: 1924: 1920: 1916: 1912: 1908: 1904: 1900: 1896: 1888: 1885: 1883: 1880: 1878: 1875: 1873: 1869: 1866: 1864: 1861: 1859: 1856: 1854: 1851: 1848: 1847:Object Pascal 1844: 1841: 1839: 1835: 1832: 1831: 1830: 1828: 1818: 1814: 1811: 1802: 1798: 1787: 1775: 1766: 1756: 1753: 1745: 1735: 1729: 1727: 1720: 1711: 1710: 1701: 1698: 1690: 1680: 1676: 1670: 1669: 1664:This section 1662: 1658: 1653: 1652: 1644: 1641: 1634: 1627: 1621: 1610: 1604: 1596: 1554: 1548: 1540: 1530: 1526: 1524: 1521: 1517: 1516: 1512: 1509: 1506: 1505: 1502: 1500: 1496: 1492: 1470: 1468: 1464: 1460: 1456: 1440: 1433: 1426: 1425: 1420: 1407: 1400: 1393: 1392: 1386: 1383: 1377: 1370: 1369: 1366:   1361: 1354: 1347: 1346: 1343:Smalltalk-80 1340: 1339: 1336: 1330: 1311: 1308: 1307: 1305: 1301: 1300: 1298: 1294: 1290: 1289: 1287: 1286: 1285: 1283: 1272: 1254: 1244: 1243: 1242: 1239: 1237: 1236:class browser 1225: 1215: 1214: 1213: 1202: 1196: 1192: 1183: 1164: 1162: 1150: 1142: 1133: 1118:Integer class 1110: 1100: 1099:Class methods 1096: 1053: 1050: 1046: 1042: 1033: 1025: 1015: 1012: 1004: 994: 990: 986: 980: 979: 975: 970:This section 968: 964: 959: 958: 874: 816:" " 752: 741: 580: 557: 512:At run time, 287: 281: 271: 269: 265: 261: 257: 253: 249: 245: 234: 231: 216: 213: 205: 194: 191: 187: 184: 180: 177: 173: 170: 166: 163: â€“  162: 158: 157:Find sources: 151: 147: 141: 140: 135:This article 133: 129: 124: 123: 114: 111: 103: 93: 89: 85: 79: 78: 73:This article 71: 62: 61: 56: 54: 47: 46: 41: 40: 35: 30: 21: 20: 3097:Metapolitics 3018:Metamodeling 2961:Metagenomics 2939:Meta-emotion 2890:Semantic Web 2884: 2771: 2584:Intersection 2262:. Retrieved 2255:the original 2242: 2221: 2210: 2198:. Retrieved 2194: 2185: 2171: 2151: 2144: 2130: 2118:. Retrieved 2114:the original 2107: 2097: 2082: 2055: 2046: 2040: 2021: 2015: 1941: 1931: 1892: 1824: 1815: 1803: 1799: 1788: 1776: 1772: 1748: 1739: 1723: 1693: 1687:October 2013 1684: 1673:Please help 1668:verification 1665: 1639: 1632: 1625: 1619: 1608: 1602: 1594: 1555: 1546: 1536: 1507:Smalltalk-80 1498: 1494: 1490: 1471: 1466: 1462: 1458: 1454: 1451: 1436: 1419:eigenclasses 1415:Eigenclasses 1414: 1403: 1357: 1329:eigenclasses 1326: 1279: 1240: 1221: 1203: 1184: 1165: 1134: 1126:Object class 1122:Object class 1111: 1097: 1054: 1038: 1007: 1001:October 2013 998: 983:Please help 971: 868: 742: 735: 558: 511: 277: 247: 241: 226: 208: 199: 189: 182: 175: 168: 156: 144:Please help 139:verification 136: 106: 97: 74: 50: 43: 37: 36:Please help 33: 3152:Metatheorem 3147:Meta-system 3137:Metascience 3083:Metaphysics 3038:Meta-object 2971:Metahistory 2951:Metafiction 2814:Type theory 2809:Type system 2659:Bottom type 2606:Option type 2547:generalized 2433:Long double 2378:Fixed point 2227:Herb Sutter 1907:CorbaScript 1858:Objective-C 1834:Common Lisp 1360:metaclasses 1049:class based 789:description 429:description 161:"Metaclass" 3157:Metatheory 3122:Metapuzzle 3068:Metaethics 2956:Metagaming 2929:Metadesign 2907:Metamemory 2719:Empty type 2714:Type class 2664:Collection 2621:Refinement 2599:metaobject 2447:signedness 2306:Data types 2264:2007-11-27 2007:References 1980:Reflection 1970:Metaobject 1945:(RDF) and 1808:using the 1459:eigenclass 1191:superclass 1174:is called 172:newspapers 84:improve it 39:improve it 3162:Metaverse 3073:Metalogic 3013:Metamedia 2976:Metahumor 2885:Metaclass 2794:Subtyping 2789:Interface 2772:metaclass 2724:Unit type 2694:Semaphore 2674:Exception 2579:Inductive 2569:Dependent 2534:Composite 2512:Character 2494:Reference 2391:Minifloat 2347:Bit array 1960:Metamodel 1882:Smalltalk 1333:Metaclass 1297:compiling 1274:Metaclass 1232:thisClass 1228:Metaclass 1180:Metaclass 1172:Metaclass 1168:Metaclass 1161:singleton 1085:Car class 1077:Car class 1073:Car class 1041:Smalltalk 972:does not 783:@property 771:metaclass 749:metaclass 423:@property 256:instances 248:metaclass 88:verifying 45:talk page 3177:Category 2944:Metamood 2924:Metadata 2819:Variable 2709:Top type 2574:Equality 2482:physical 2459:Rational 2454:Interval 2401:bfloat16 2195:Ruby Doc 2191:"Struct" 2120:June 28, 2064:Archived 1985:Dynamism 1953:See also 1915:Object-Z 1911:ObjVLisp 1895:OpenJava 1806:NSObject 1428:Terminal 1372:Terminal 1358:Implicit 1189:) has a 855:__dict__ 650:__call__ 602:__call__ 530:__init__ 303:__init__ 2762:Generic 2738:Related 2654:Boolean 2611:Product 2487:virtual 2477:Address 2469:Pointer 2442:Integer 2373:Decimal 2368:Complex 2356:Numeric 1933:Logtalk 1919:MODEL-K 1903:OpenAda 1899:OpenC++ 1430:objects 1406:classes 1396:Classes 1374:objects 1350:Classes 1323:In Ruby 1260:Integer 1163:class. 1157:C class 1141:methods 1114:Integer 1107:Integer 1071:called 993:removed 978:sources 878:new_car 701:setattr 186:scholar 82:Please 2752:Boxing 2740:topics 2699:Stream 2636:tagged 2594:Object 2517:String 2159:  2109:ONLamp 2028:  1937:Prolog 1925:, and 1863:Python 1853:Groovy 1843:Delphi 1836:, via 1611:.class 1595:x ↦ x. 1586:Struct 1574:Struct 1572:, and 1510:  1270:, etc. 1264:Widget 1252:, etc. 1246:Object 1206:Object 1193:. The 1187:Object 1045:object 938:engine 861:values 813:return 765:object 728:return 689:kwargs 626:kwargs 571:, and 507:" 459:" 453:return 280:Python 254:whose 188:  181:  174:  167:  159:  2861:Meta- 2647:Other 2631:Union 2564:Class 2554:Array 2337:Tryte 2258:(PDF) 2251:(PDF) 2234:(PDF) 2200:1 May 1927:MELDC 1923:XOTcl 1872:Moose 1810:Cocoa 1791:Class 1628:class 1615:Class 1598:class 1591:class 1582:Class 1578:Class 1570:Class 1562:Class 1558:class 1513:Ruby 1389:Ruby 1293:state 1266:, or 1262:, or 1256:Class 1222:Like 1210:Class 1199:Class 1137:Class 1130:Class 926:color 902:model 843:value 834:value 801:-> 756:class 719:value 695:items 683:value 584:class 573:color 565:model 501:model 471:color 441:-> 420:color 414:color 390:model 384:model 351:color 327:model 291:class 252:class 250:is a 193:JSTOR 179:books 2767:Kind 2729:Void 2589:List 2504:Text 2342:Word 2332:Trit 2327:Byte 2202:2015 2157:ISBN 2122:2006 2074:and 2026:ISBN 1877:Ruby 1868:Perl 1838:CLOS 1782:and 1584:and 1485:and 1477:and 1295:for 976:any 974:cite 920:2005 914:year 890:make 849:self 822:join 795:self 738:type 713:name 677:name 665:args 656:self 644:type 617:args 608:self 593:type 577:type 569:year 561:make 554:type 546:type 518:type 495:self 486:make 480:self 465:self 435:self 408:self 405:year 399:year 393:self 378:self 375:make 369:make 363:self 339:year 315:make 309:self 284:type 246:, a 165:news 2626:Set 2322:Bit 1887:C++ 1677:by 1549:to 1461:of 1268:Car 1250:Car 1145:new 1095:.) 1093:Car 1081:Car 1069:Car 1065:Car 1061:Car 1039:In 987:by 884:Car 871:Car 864:()) 840:for 828:str 804:str 786:def 759:Car 745:Car 731:obj 707:obj 698:(): 674:for 638:obj 599:def 550:Car 542:Car 538:Car 534:Car 526:Car 522:Car 514:Car 444:str 426:def 357:str 345:int 333:str 321:str 300:def 294:Car 278:In 242:In 148:by 86:by 3179:: 2229:. 2193:. 2106:. 2070:, 1921:, 1917:, 1913:, 1909:, 1905:, 1901:, 1897:, 1795:id 1643:. 1553:. 1417:of 1384:→ 1182:. 846:in 780:): 740:. 686:in 629:): 623:** 596:): 579:. 567:, 563:, 556:. 360:): 48:. 2853:e 2846:t 2839:v 2298:e 2291:t 2284:v 2267:. 2236:. 2204:. 2179:. 2165:. 2138:. 2124:. 2076:3 2072:2 2061:1 2034:. 1755:) 1749:( 1744:) 1740:( 1730:. 1700:) 1694:( 1689:) 1685:( 1671:. 1640:x 1633:x 1626:x 1620:x 1609:x 1603:x 1566:c 1551:v 1543:v 1499:x 1495:x 1491:x 1487:v 1483:u 1479:B 1475:A 1467:x 1463:x 1455:x 1153:C 1103:2 1057:c 1014:) 1008:( 1003:) 999:( 995:. 981:. 947:) 941:= 935:, 929:= 923:, 917:= 911:, 905:= 899:, 893:= 887:( 881:= 858:. 852:. 837:) 831:( 825:( 819:. 807:: 798:) 792:( 774:= 768:, 762:( 722:) 716:, 710:, 704:( 692:. 680:, 668:) 662:* 659:, 653:( 647:. 641:= 620:, 614:* 611:, 605:( 590:( 504:} 498:. 492:{ 489:} 483:. 477:{ 474:} 468:. 462:{ 456:f 447:: 438:) 432:( 417:= 411:. 402:= 396:. 387:= 381:. 372:= 366:. 354:: 348:, 342:: 336:, 330:: 324:, 318:: 312:, 306:( 297:: 233:) 227:( 215:) 209:( 204:) 200:( 190:· 183:· 176:· 169:· 142:. 113:) 107:( 102:) 98:( 80:. 55:) 51:(

Index

improve it
talk page
Learn how and when to remove these messages
original research
improve it
verifying
inline citations
Learn how and when to remove this message

verification
improve this article
adding citations to reliable sources
"Metaclass"
news
newspapers
books
scholar
JSTOR
Learn how and when to remove this message
Learn how and when to remove this message
object-oriented programming
class
instances
programming languages
first-class citizens
metaobject protocol
Python

cite
sources

Text is available under the Creative Commons Attribution-ShareAlike License. Additional terms may apply.

↑