Procedures associated with Loader(s)


The procs below are not associated with a particular class. These procs were defined in Loader.tcl, but no class was defined.
::tycho::loadIfNotPresent {command package {packagePathList {}}}
Load 'package' if 'command' is not present. If we can't load package, then search first in the Ptolemy tcl tree, Then prompt the user for the file to be loaded. If the package still cannot be loaded, return an error.

The optional packagePathList argument consists of a list of 2 element sublists that contain other package names and pathnames to try and load packagePathList can be used to try to load the package under an alternative name. The sublists consists of two elements, an alternative packagename and a directory to try loading in. The alternative packagename can be empty.

The example below attempts to load TclX to get the profile command. If TclX can't be found, then it looks in $tycho/lib/profile/obj.$PTARCH for a file named tclXprofile.ext, where ext is the sharedlibrary extension returned by [info sharedlibextension]. If that file can't be found then it looks in /users/ptdesign/lib/profile/obj.$PTARCH for the same file

tycho::loadIfNotPresent profile tclx \
               [list [list tclXprofile \
               [file join $tycho lib profile obj.$env(PTARCH)]] \
               [list tclXprofile \
               [file join / users ptdesign lib profile obj.$env(PTARCH)]]]  
.

Index of classes



Author: Christopher Hylands, Edward A. Lee
Version: @(#)Loader.tcl 1.9 11/29/96
Copyright: (c) 1996 The Regents of the University of California.