[previous] [up] [next]     [contents] [index]
Next: Creating Classes Up: Classes and Objects Previous: Object Example

Creating Interfaces

Interfaces are created with the interface form:

  (interface (super-interface-expr  tex2html_wrap_inline12550 ) variable  tex2html_wrap_inline12550 ) 

All of the variables must be distinct.

Each super-interface-expr is evalauted (in order) when the interface expression is evaluated. The result of each super-interface-expr must be an interface value, otherwise the exn:object:interface-type exception is raised. The interfaces returned by the super-interface-exprs are the new interface's superinterfaces, which are all extended by the new interface.

The result of an interface expression is an interface that includes all of the specified variables, plus all variables from the superinterfaces. (Duplicate variable names from the superinterfaces are ignored.) Any class that implements the new interface also implements all of the superinterfaces.



PLT