[Openmcl-devel] Re: logical pathname conundrum

james anderson james.anderson at setf.de
Thu Feb 19 19:34:32 PST 2004

On Thursday, Feb 19, 2004, at 23:59 Europe/Berlin, Gary King wrote:

> Here is some code to make a pathname:
> (setf (logical-pathname-translations "foo")
>       '(("foo:**;*.*" #P"Users:gwking:**:*.*")))
> (setf (logical-pathname-translations "foo")
>       '(("foo:**;*.*" "/Users/gwking/**/*.*")))

you probably don't want to do this. use pathname constructors. if you  
do somthing like

(setf (logical-pathname-translations "foo")
	`(("foo:**;*.*" (make-pathname :directory '(:absolute "Users" "gwking"  
                                     :name :wild :type :wild))))

you will save yourself - and anyone who should ever need to port your  
code - a lot of grief in the long run.

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

mcl is off the mark. the merging in make-pathname is not the same as in  
merge-pathnames. the value specified with :directory '(:relative "c")  
is a value. as would be the value nil. the defaults apply when no value  
is supplied only. the merging is "... used to fill in any  
<em>unsupplied</em> components ...."


note that the rule for the default host means that the more portable  
form will need to be something like

(merge-pathnames (make-pathname :name "a" :type "b" :directory  
'(:relative "c")
                                 :defaults (make-pathname :host "foo"))
                  (make-pathname :directory '(:absolute "tinaa")))


(merge-pathnames (make-pathname :name "a" :type "b" :directory  
'(:relative "c") :host nil)
                  (make-pathname :directory '(:absolute "tinaa") :host  

but you'd have to verify those. (whereby, all the components are  
explicit here, but i suspect you are intending to supply variables for  
some of them.)


More information about the Openmcl-devel mailing list