12.3.2 Creation of generic functions
You can create a generic function in the following ways:
You can create one explicitly by calling
makeon the<generic-function>class. You rarely need to create a generic function this way.You can create one implicitly by
define method. If the generic function named by this definition does not yet exist, Dylan creates it.You can create one implicitly by defining a slot in
define class. If a getter generic function for the slot does not yet exist, Dylan creates it.You can create one implicitly by defining a slot (other than a constant slot) in
define class. If a setter generic function for the slot does not yet exist, Dylan creates it.
Each of these procedures, except a call to make, defines a module constant whose value is the generic function created.
When Dylan creates a generic function implicitly, it creates a parameter list and a value declaration for the generic function that are designed to restrict the addition of subsequent methods to the generic function as little as possible. All required arguments to the generic function have type specializers of <object>, and the generic function can return any number of values of any type. The generic function's parameter list is congruent with that of the method being defined. If the generic function accepts keyword arguments, the parameter list ends with #key.




