Next: , Previous: , Up: using libraries   [Index]


2.4.3 Library search paths

Vicare has a search algorithm for libraries that is similar to those used in other languages. Vicare’s search path comprises a series of directories; when we try to import a library whose name contains just one component, Vicare will examine each directory in the search path for a file with a matching name. Importing a library whose name is a list of components causes Vicare to look for a series of subdirectories with matching names.

There are two search paths, one for binary libraries and one for source libraries:

both these parameters are meant to contain lists of strings representing directory pathnames and can be updated as necessary.

In programs intended to be distributed, we should resist the urge to set library-binary-search-path and library-source-search-path, as the user’s file hierarchies might not match ours; for most libraries, simply telling the user to install the files in one of the directories on the search path is good enough.