[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
file loading query
- To: Dave.Touretzky\@email@example.com, firstname.lastname@example.org
- Subject: file loading query
- From: email@example.com
- Date: Fri, 16 Dec 88 17:30:56 PST
- Cc: common-lisp\@firstname.lastname@example.org
- In-reply-to: Jon L White's message of Fri, 16 Dec 88 01:22:08 PST <8812160922.AA20998@bhopal>
re: 1. Anybody know a *portable* trick I can use to get embedded calls to LOAD
to use the parent file's pathname as a default?
You needn't be a privileged implementor to use Lucid's idea.
This should be portable:
(defvar *my-load-pathname* nil)
(defun my-load (partial-path)
(let ((*my-load-pathname* (merge-pathnames partial-path *my-load-pathname*)))
and replace all calls to load in files with calls to my-load, e.g.,
A more general thing involving twiddling the prefix of a directory tree
from which embedded loads will occur in various subdirectories might be
(defun load-from-subtree (partial-path path-function)
(let ((*my-load-pathname* (funcall path-function partial-path *my-load-pathname*)))
and replace embedded load calls with load-from-subtree. Typically the
path-function will concatenate the directories of *my-load-pathname* and
partial-path, or something. At least on Lucid 3.0, merge-pathnames serves
as such a function, as in (merge-pathnames "arith/bignum" "~/broken/mork.bin").