s c h e m a t i c s : c o o k b o o k

/ Cookbook.FileChangePLTPath

This Web


WebHome 
WebChanges 
TOC (with recipes)
NewRecipe 
WebTopicList 
WebStatistics 

Other Webs


Chicken
Cookbook
Erlang
Know
Main
Plugins
Sandbox
Scm
TWiki  

Schematics


Schematics Home
Sourceforge Page
SchemeWiki.org
Original Cookbook
RSS

Scheme Links


Schemers.org
Scheme FAQ
R5RS
SRFIs
Scheme Cross Reference
PLT Scheme SISC
Scheme48 SCM
MIT Scheme scsh
JScheme Kawa
Chicken Guile
Bigloo Tiny
Gambit LispMe
GaucheChez

Lambda the Ultimate
TWiki.org

Dynamically Changing the PLT Search Path

Problem

You want to change the path where PLT searches for modules at runtime.

Solution

current-library-collection-paths will set the PLT library search path for you, based upon the list of strings you supply it. For example:

> (current-library-collection-paths 
   (append (current-library-collection-paths)
           '("d:\\source\\scheme\\schematics\\src\\libs")))

current-library-collection-paths with no arguments will return the current search path, so the append statement above has the effect of appending the given directory to the end of the collection search path.

Discussion

The library collection path is what is searched when you use a (require (lib ...)) statement. If you get an error standard-module-name-resolver: collection not found, you have a require that wasn't resolved. This technique works well when you're developing a collection that you don't want to install in the PLT search path just yet. There are a number of utilty functions that PLT provides for collections: find-library-collection-paths will tell you the current paths that PLT will search, but it's the initialized values, and is not affected by modifications done with current-library-collection-paths.

> (find-library-collection-paths)
("C:\\Documents and Settings\\gweakliem\\Application Data\\PLT Scheme\\207\\collects" 
"C:\\Program Files\\PLT\\collects")

collection-path will tell you what directory a given collection is loaded from:

> (collection-path "srfi")
"C:\\Program Files\\PLT\\collects\\srfi"


Comments about this recipe

Contributors

-- GordonWeakliem - 13 Aug 2004

CookbookForm
TopicType: Recipe
ParentTopic: FileRecipes
TopicOrder: 999

 
 
Copyright © 2004 by the contributing authors. All material on the Schematics Cookbook web site is the property of the contributing authors.
The copyright for certain compilations of material taken from this website is held by the SchematicsEditorsGroup - see ContributorAgreement & LGPL.
Other than such compilations, this material can be redistributed and/or modified under the terms of the GNU Lesser General Public License (LGPL), version 2.1, as published by the Free Software Foundation.
Ideas, requests, problems regarding Schematics Cookbook? Send feedback.
/ You are Main.guest