[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Logical pathname bug?

Christopher Fry (cfry@MIT.EDU) writes about problems using
logical pathnames:
  I define some logical pathnames.
  I use them to load some .lisp files.
  The files load fine. I can meta-point functions defined in them.
  They have pathnames like "hd:ccs:oval:foo.lisp".
  When I eval a defun in such a file I get the warning message
  ;Warning:  FUNCTION LIST-OF-VALUES previously defined in:
  ;                  is now being redefined in: root:hd;eval.lisp
  Now when I meta point the fn, I get a choice of two pathnames, neither
  of which are
  correct, and neither of which are either of the above two. They are:
  "eval.lisp {hd;}" and
  "eval.lisp {}"
  Choosing the first errors with
  > Error: File #4P"root:hd;eval.lisp" does not exist.
  (it's true that that file doesn't exist, but why did meta-point think it
  Choosing the second works fine.
  The directory in the title bar of a fred window editing the file is
  the correct physical directory.
  Inspecting the window shows that its instance variable ccl::my-file-name
  is the correct full physical pathname.
  I play some tricks with defining logical pathnames. Its likely I'm doing
  something wrong. CLtL2 has done an excellent job of documenting a very
  complex mechanism obscurly. If there are better explanations of logical
  pathnames, please tell me where. But it still sounds like MCL2 is
  inconsistent here.

I still don't understand logical pathnames either. But I've developed
an approached based on Guillame Cartiers extended-apropos
package. Logical pathname translations replace the old-style
logical directories.

Surely we need to cover this topic in the new MCL FAQ currently
under development.

It wasn'tg easy converting from the old style
directories to the new logical pathnames.  I hope the following

Here is an example of the old (MCL2.0b1p3) way of defining logical
pathnames for the toplevel (ccl) directory
    (def-logical-directory "Lisp.root"  "CCL")
and using this logical directory to define a a sub-directory:
    (def-logical-directory "Utilities" "CCL;utilities:")

Here is the replacement in MCL final which uses logical hosts:
    (setf (logical-pathname-translations "mcl")
          (list (list "mcl:**;*.*"

    (setf (logical-pathname-translations "Utilities")
          (list (list "Utilities:**;*.*"

Here is the method I use to expand the logical name when I use
the defsys utility developed by Mark Kantorwitz at CMU:

    (defmacro logical-to-name (logical-name &optional rest)
      "Allow the expansion of logical pathnames"
      `(if ,rest
         (format nil "~a~a" (mac-directory-namestring 
                             (truename ,logical-name))
         (mac-directory-namestring (truename ,logical-name))))

    (defun translate-name (top-dir &optional sub-dirs file)
      (let (main-dir)
        (if file
          (setq main-dir (logical-to-name top-dir sub-dirs))
          (setq main-dir (logical-to-name top-dir)
                file sub-dirs))
        (format nil "~a~a"  main-dir file)))

Here is the way that to load the file logical-pathnames.lisp
in the subdirectory utilities:
    (load (translate-name "CCL:" "utilities:" "logical-pathnames.lisp"))