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

5.12.5 Using Other Modules

We’ve already seen one way to use other module in the previous subsection. It was open.

There’re three aspects in module access:

We’ll see these three in turn.

Function load loads any file, not only module definitions, and evaluate each form in it, but load does NOT import bindings. For the full doc, see See Load Function.

We’ve seen open clause. If specified modules are not yet loaded into Rep, then they’re loaded. It also imports exported bindings.

The alternative, access is available, too. With access, exported bindings can be referred to by specifying the module it belongs to:

;; These three are equivalent
(structure-ref varX) ;; short form of structure-ref
(external-structure-ref ' 'varX)

One of open or access clauses can only be used at the module definition, but there’re equivalent lisp functions. require and open-structures correspond to open, and access-structures to access:

Function: require module
Function: open-structures list
Function: access-structures list


(require '
(open-structures '( baz))
(access-structures '( baz))

All loads modules to Rep if not yet, and import the bindings of specified modules, in the same way as open or access. The latter two are defined in rep.structures.

If the load fails, an error is signaled.

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