Next: , Previous: , Up: Modules   [Contents][Index]

5.12.12 Module Interfaces

Module’s interface is the set of bindings (i.e. functions, macros or variables) that it exports to other modules. Interfaces may either be defined and then referenced by name, written literally, or combined from a number of sources.

The syntax of interface definitions is as follows:

interface -> (export id …)
          |  name
          |  (compound-interface interface …)
          |  (structure-interface module-name)

where each id is the name of a binding to export, and each name is the name of an interface previously defined using define-interface.

Macro: define-interface name interface

Associate the symbol name with the module interface interface (using one of the forms listed above.

Here is an example defining an interface called foo:

(define-interface foo (compound-interface bar (export baz quux)))

It includes the interface called bar and adds two extra exported symbols: baz and quux.

Function: structure-interface str

returns the interface of structure object str.

Function: set-interface str int

Set the interface of structure object str to int.