Version 1, March 1993
This design note gives an expanded specification for <class> which enables new classes to be created at runtime, with make.
Replace the specification of <class> on page 91 of the Dylan manual with the following:
<class> [Abstract Class]All classes (including <class>) are general instances of <class>. <class> is a subclass of <type>.
In most programs the majority of classes are created with defineclass. However, there is nothing to prevent programmers from creating classes by calling make, for example, if they want to create a class without storing it in a module variable, or if they want to create new classes at runtime.
The class <class> supports the following init-keywords:
Examples:
(make <class>
superclasses: <object>
slots: `((getter: ,point-x
setter: ,point-x-setter
init-keyword: ,x:
init-value: ,0
type: ,<integer>)
(getter: ,point-y
setter: ,point-y-setter
init-keyword: ,y:
init-value: ,0
type: ,<integer>)))
(make <class>
superclasses: `(,<input-stream> ,<output-stream>)
slots: `((getter: ,stream-cache
setter: ,stream-cache-setter
init-keyword: ,cache:)))
Or, in a different style:
(make <class>
superclasses: <object>
slots: (vector (vector getter: point-x
setter: point-x-setter
init-keyword: x:
init-value: 0
type: <integer>)
(vector getter: point-y
setter: point-y-setter
init-keyword: y:
init-value: 0
type: <integer>)))
(make <class>
superclasses: (vector <input-stream> <output-stream>)
slots: (vector (vector getter: stream-cache
setter: stream-cache-setter
init-keyword: cache:)))
Next chapter: #4: No Incremental Class Modifications (Change)