Previous section: Declaring characteristics of classes

Dylan reference manual -- Declaring sealing of generic functions

Declaring sealing of generic functions

A generic function definition (see the previous chapter on Functions) may include the adjective sealed or the adjective open. These adjectives declare whether the generic function is sealed..

If a generic function is sealed then no additional methods other than those explicitly defined in the same library may be added to the generic function. Thus, it is an error to define a method for a sealed generic function in some library other than the one which defined the sealed generic function, or to apply add-method or remove-method to a sealed generic function. An open generic function does not prohibit such operations.

When explicitly defining a generic function, the default is for the generic function to be sealed. This may be overridden by explicitly specifying that it is open. A generic function that has no explicit definition but has implicit definitions provided by explicit definitions of generic function methods for it is sealed. A generic function created using make of <generic-function> is open. There is no specified way to create a sealed generic function using make.

Next section: The seal generic form