[Openmcl-devel] Re: Another pathname question

Gary King gwking at cs.umass.edu
Fri Feb 27 13:36:50 UTC 2004


Whoopt, my bad about (load-pathname). It's a function I should have 
included:

(defun load-pathname ()
     "Returns a pathname that is useful for merging with filenames to 
get a
complete pathname for a file in the same directory as the one currently 
being
loaded.  This function is a more portable version of the Common Lisp 
variable
*load-truename*, since not all vendors implemented that correctly."
     (let ((pn   #+allegro (translate-logical-pathname (truename 
excl:*source-pathname*))
                 #+MCL (if *load-truename*
                         (translate-logical-pathname *load-truename*)
                         ;; This makes it work in a fred buffer...
                         (translate-logical-pathname 
*loading-file-source-file*))
                 #+Lispworks (translate-logical-pathname *load-truename*)
                 #-(or allegro MCL Lispworks)
                 (translate-logical-pathname *load-truename*)))
       (assert (pathnamep pn) (pn)
               "load-pathname* did not return a pathname, it returned ~s;
this might be because it executed in a context where you're not loading 
a file
or because the file is in the current working directory.  In any event, 
this
will break the code in generic-load-utils, because it works with the 
components
of pathnames." pn)
       ;; Deal with the lispworks using an empty pathname for 
*default-pathname-defaults*
       ;; if you are loading from the current working directory.
       (values
        #-lispworks pn
        #+lispworks
        (if (null (pathname-directory pn))
          (merge-pathnames pn (current-pathname)) pn))))

As for your fix, it works for me under MCL but not under OpenMCL or 
LispWorks, same problem as before.

On Feb 26, 2004, at 4:02 PM, Octav Popescu wrote:

> One thing that might be problematic is load-pathname. I couldn't find 
> it in the hyperspec index, I don't know if it's part of the standard. 
> There is a *load-pathname* variable however.
>
-- 
Gary Warren King, Lab Manager
EKSL East, University of Massachusetts * 413 577 0176

I am shocked at how little my colleagues in genetics pay attention to 
history. They actually forget how ignorant we are—that although we have 
achieved incredible manipulative powers, we know next to nothing about 
the real world in which those manipulations will reverberate.
   -- David Suzuki (http://www.davidsuzuki.org/)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: text/enriched
Size: 2512 bytes
Desc: not available
URL: <http://lists.clozure.com/pipermail/openmcl-devel/attachments/20040227/7281d54f/attachment.bin>


More information about the Openmcl-devel mailing list