Sealing

Classes and generic functions may be sealed using a number of Dylan forms. This prevents code in other libraries from subclassing objects or adding methods to generic functions, and lets the compiler optimize more effectively. Both classes and generic functions are sealed by default.

To allow code in other libraries to subclass a given class, declare it as open:

define open class <sample> (<object>) end;
      

To allow other libraries to add methods to a generic function, use a similar syntax:

define open generic sample-function( o :: <object> ) => ();
      

A third form, define inert domain, partially seals a generic function, disallowing only some additions from outside a library.

For more information on sealing, see the chapter “Controlling Dynamism” in the Dylan Reference Manual .