Details
This design is inspired by Python classes.
Every class has the following definitions with a built-in meaning: "$New", "$Extend", "$Class", "$Parent", "$Label", "$Type", "$Test", "$Init", "$Format", "$Normal", "$N", "$Icon", "$Properties", "$ClassMethods".
An instance of a class can be created using the "$New" method:
class["$New"|"$New"[arguments], label]
instantiate a new instance of a given class with an optional label.
Each instance is also a class and can serve as a prototype for a different instance of the same class by extending its definitions using the "$Extend" method.
instance["$Extend"|"$Extend"[arguments], label]
extend an instance by inheriting its definitions with an optional label.
Creating subclass is the same as extending its parent class and storing result as its value, i.e. Class[name →class,…] is the same as class[name] = class["$Extend"[…]].
Class is its own class, instance and parent.
Instance methods are strings that are usualy defined using this schema: class["Method"[self_, args___]] := …
Class constructor is defined using "$Init" method (like __init__ in Python).
Default "$Init" constructor is a Class constructor, which takes a sequence of rules to initialize its values. Anything besides a rule is set to
None.
Formatting is specified using "$Format" method (like __repr__ in Python). Default formatting uses the "$Icon" property for its summary box.
"$Normal" and "$N" define correspoding values for
Normal and
N.
"$Properties" are methods without arguments.
"$ClassMethods" are methods that pass its class as a first argument.