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


5.12.8 Module Aliases

Librep provides rudimetary support of module alias.

Macro: define-structure-alias alias module

Module named module will have the alias alias. This macro is usually called inside of the definition of that module, but can be called from anywhere, but module has to be defined already.

(define-structure-alias baz foo.bar.baz)

Module can be imported via aliases, too. In the above example, both of these become possible:

(require 'baz)
(require 'foo.bar.baz)

If you use access, then only the name used in access is allowed.

(access baz)
...
(baz#some-func) ;; ok
(foo.bar.baz#some-func) ;; no

If a module is part of Librep or Sawfish, then you can load the module by its alias even when the module is not yet loaded, i.e. when the module alias is not yet defined! This is achieved simply with symbolic links prepared at installation time.