View this PageEdit this PageUploads to this PageHistory of this PageTop of the SwikiRecent ChangesSearch the SwikiHelp Guide

Squeak vs. SuperCollider Class systems

Comparing the class systems of Squeak and SuperCollider.
Here is a transcript of different things IZ and JR tried out on a nice Friday morning in February 2001 at the SIM office:

The class of the class of ... an object in SuperCollider:

1.class -> Integer 
1.class.class -> Meta_Integer 
1.class.class.class -> Class 
1.class.class.class.class -> Meta_Class 
1.class.class.class.class.class -> Class 
1.class.class.class.class.class.class -> Meta_Class 
1.class.class.class.class.class.class.class -> Class 

In other words... some facts:
  1. An object such as a number is an instance of a class, such as Integer.
  2. A class such as Integer is the sole instance of a class called Meta_, (i.e. the class of Integer is Meta_Integer). That is: each "metaclass" has only one instance, namely the class it defines
  3. A :"metaclass" such as Meta_Integer is an instance of Class
  4. Class is an instance of Meta_Class. By 2 above, Class is the sole instance of Meta_Class.
  5. Meta_Class is an instance of Class
  6. Circularity:In SuperCollider, Class is the sole instance of Meta_Class and Meta_Class is the sole instance of Class.
  7. All metaclasses are instances of Class, so is Meta_Class. So Class has as many instances as there are metaclasses.

The class of the class of ... an object in Squeak:

1 class -> SmallInteger
1 class class -> SmallInteger class
1 class class class -> Metaclass
1 class class class class -> Metaclass class
1 class class class class class -> Metaclass
1 class class class class class class -> Metaclass class
1 class class class class class class class -> Metaclass

So:
  1. An object such as a number is an instance of a class, such as SmallInteger.
  2. A class, such as SmallInteger, is the sole instance of its "class-class". This is parallel to SuperCollider's "Meta_<class>" group of objects, but prints in the form of <Classname> class, not in the form "Meta_<class>". For example, in SuperCollider the result of the expression
    LinkedList.class</code >,  prints as <code>Meta_LinkedList</code >, whereas in Squeak the result of the expression <code>LinkedList class</code > prints as <code>LinkedList class
    . Note that the result prints identical to the expression evaluated but in fact the first one is an expression where the message "class" is sent to the object "LinkedList" and the second one represents the object "LinkedList class", which is the class of LinkedList.
  3. The "class-classes" are all instances of Metaclass.
  4. Metaclass is the sole instance of Metaclass-class. So the difference is that in SuperCollider Meta_Class is an instance of Class, but in Squeak Metaclass is an instance of "Metaclass class".

The instances and subclasses of Class

Ergo: SuperCollider uses both instances of Class and subclasses of Class to define Metaclasses. Squeak uses subclasses of Class to define its class-classes, but it does not use any instances of the class Class itself.






..

Links to this Page