Next section: 9. Collections## The seal generic form

There is also aseal generictop-level form, with the following syntax:seal genericfunction(type, ...);

Thefunctionmust be a module variable that refers to a generic function.The

typesmust be expressions that evaluate to instances of<type>. The number oftypesmust be the same as the number of required arguments accepted by thefunction.A

seal genericform in a library L for a generic function G with types T1...Tn imposes the following constraints on programs:

- A method M which is congruent to G and which is not an explicitly known method in L may be added to G if and only if at least one of the specializers for M is disjoint from the corresponding type in the sealing form.
- A method M may be removed from G if and only if at least one of the specializers for M is disjoint from the corresponding type in the sealing form.
- A class C with direct superclasses D1...Dm and which is not an explicitly known class in L may be created if and only if
- none of the classes D1...Dm are subtypes of any of the types T1...Tn in the sealing form, or
- for every method M in G with specializers S1...Sn, if there exists an i such that Si is disjoint from Ti, then M must satisfy condition (1) below, otherwise M must satisfy condition (2) below.
- There exists an i such that Si is disjoint from Ti and such that there do not exist j and k such that Dj is a subtype of Si and Dk is a subtype of Ti.
- There do not exist i, j, and k such that Dj and Dk are subtypes of Ti, Dj is disjoint from Dk, Dj is a subtype of Si, and Dk is not a subtype of Si.
## Abbreviations for seal generic

define sealed methoddefines a normal method and then seals the generic function for the types that are the specializers of the method.define sealed methodis a convenient abbreviation for theseal genericform.

The

sealed slotoption todefine classdefines a normal slot and then seals the getter generic function for the class, and seals the setter generic function, if there is one, on<object>and the class. Thesealed slotoption todefine classis a convenient abbreviation for theseal genericform.