[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Mark Kantrowitz's LOGICAL-PATHNAMES?
- To: Chewy@cup.portal.com
- Subject: Re: Mark Kantrowitz's LOGICAL-PATHNAMES?
- From: "Mark A. Tapia" <email@example.com>
- Date: Wed, 22 Sep 1993 16:10:22 -0400
- Cc: firstname.lastname@example.org
On Wednesday 22 SEP 1993, Paul Snively writes:
I was wondering whether anyone had gotten MK's LOGICAL-PATHNAMES working in
The answer is in two parts. Yes MCL understands logical pathnames
and NO, defsystem doesn't understand them. But there is a way to
use them. Load also seems to have a problem loading files and needs
a similar fix.
Thanks to Guillame Cartier for his help in defining logical pathnames
for his extended apropos.
The following is a simple method for defining logical pathnames:
The following defines mcl: as the toplevel directory (ccl) and uses it to
define the examples directory as a logical name for the examples folder
(setf (logical-pathname-translations "mcl")
(list (list "mcl:**;*.*"
(setf (logical-pathname-translations "Examples")
(list (list "Examples:**;*.*"
Now you can load the scrolling-windows from examples:
If you are using Mark Kantorwitz's Defsystem utiltity, logical pathnames
don't work correctly. Fortunately there is a fix.
The following macros translate the logical names into objects
that defsystem and load understand.
(defmacro logical-to-name (logical-name &optional rest)
"Allow the expansion of logical pathnames"
(format nil "~a~a" (mac-directory-namestring
(mac-directory-namestring (truename ,logical-name))))
(defun translate-name (top-dir &optional sub-dirs file)
(setq main-dir (logical-to-name top-dir sub-dirs))
(setq main-dir (logical-to-name top-dir)
(format nil "~a~a" main-dir file)))
Here's an example that loads a file in the fasl subdirectory
in the examples folder:
(load (logical-to-name "Examples:fasls;" "array-dialog-item"))
Here's an example that uses the macros to define the print-u system
that I added to the contrib library. The file is assumed to be
in the directory ccl:menu enhancements:
:source-pathname (logical-to-name "CCL:" "menu enhancements:")
:binary-pathname (logical-to-name "CCL:" "menu enhancements:fasls:")
:components ((:file "print-u"))
:initially-do (progn (CCL::require-interface :printTraps)