[Openmcl-devel] logical pathname conundrum

Gary King gwking at cs.umass.edu
Thu Feb 19 14:59:09 PST 2004


Here is some code to make a pathname:

#+DIGITOOL
(setf (logical-pathname-translations "foo")
       '(("foo:**;*.*" #P"Users:gwking:**:*.*")))

#-DIGITOOL
(setf (logical-pathname-translations "foo")
       '(("foo:**;*.*" "/Users/gwking/**/*.*")))

(make-pathname :name "a"
                :type "b"
                :directory '(:relative "c")
                :defaults "foo:tinaa;")

Here is what four different Lisps returned. Three agree and MCL is out  
in the cold.

MCL       ==> #4P"foo:tinaa;c;a.b"
OpenMCL   ==> #4P"foo:;c;a.b"
LispWorks ==> #P"FOO:;C;A.B"
SBCL      ==> #.(CL:LOGICAL-PATHNAME "FOO:;C;A.B")

But section 19.4.17 of  
http://www.franz.com/support/documentation/6.2/ansicl/dictentr/merge- 
pa.htm states that:

> Pathname merging treats a relative directory specially. If  
> (pathname-directory pathname) is a list whose car is :relative, and   
> (pathname-directory default-pathname) is a list, then the merged  
> directory is the value of
>
>
>  (append (pathname-directory default-pathname )
>          (cdr  ;remove :relative from the front
>            (pathname-directory pathname )))
>
>  except that if the resulting list contains a string or :wild  
> immediately followed by :back, both of them are removed. This removal  
> of redundant :back keywords is repeated as many times as possible. If  
> (pathname-directory default-pathname) is not a list or  
> (pathname-directory pathname) is not a list whose car is :relative,  
> the merged directory is (or (pathname-directory pathname)  
> (pathname-directory default-pathname))

Now (pathname-directory "foo:tinaa;") ==> (:ABSOLUTE "tinaa") and  
(pathname-directory #P"c/a.b") ==> (:RELATIVE "c"). So it seems to me  
that

>  (append (pathname-directory default-pathname )
>          (cdr  ;remove :relative from the front
>            (pathname-directory pathname )))

would go to (:ABSOLUTE "tinaa" "c"). It seems to me that MCL is correct  
and the others are not but this wouldn't be the first time I've  
misinterpreted the standard <smile>.

Thanks,
-- 
Gary Warren King, Lab Manager
EKSL East, University of Massachusetts * 413 577 0176

"This is the greatest blessing.  To live righteously, to give help to  
kindred, to follow a peaceful calling? This is the greatest blessing."
   -- The Buddha




More information about the Openmcl-devel mailing list