Next: , Previous: , Up: Design Choices and Extensions   [Contents][Index]


2.28 Extension to REQUIRE

The behavior of require when called with only one argument is implementation-defined. In CMUCL, functions from the list *module-provider-functions* are called in order with the stringified module name as the argument. The first function to return non-NIL is assumed to have loaded the module.

By default the functions module-provide-cmucl-defmodule and module-provide- cmucl-library are on this list of functions, in that order.

Variable: ext:*module-provider-functions*

This is a list of functions taking a single argument. require calls each function in turn with the stringified module name. The first function to return non-NIL indicates that the module has been loaded. The remaining functions, if any, are not called.

To add new providers, push the new provider function onto the beginning of this list.

Macro: ext:defmodule name &rest files

Defines a module by registering the files that need to be loaded when the module is required. If name is a symbol, its print name is used after downcasing it.

Function: ext:module-provide-cmucl-defmodule module-name

This function is the module-provider for modules registered by a ext:defmodule form.

Function: ext:module-provide-cmucl-library module-name

This function is the module-provider for CMUCL’s libraries, including Gray streams, simple streams, CLX, CLM, Hemlock, etc.

This function causes a file to be loaded whose name is formed by merging the search-list “modules:” and the concatenation of module-name with the suffix “-LIBRARY”. Note that both the module-name and the suffix are each, separately, converted from :case :common to :case :local. This merged name will be probed with both a .lisp and .fasl extensions, calling LOAD if it exists.


Next: Localization, Previous: Modular Arithmetic, Up: Design Choices and Extensions   [Contents][Index]