[Openmcl-devel] Using :up in logical pathnames

Andrew Shalit alms at clozure.com
Sat Jan 6 14:08:22 PST 2007


Should OpenMCL allow you to create logical pathnames that have (:ABSOLUTE :UP) as their directory component?

Sometimes it does:


? (translate-logical-pathname #p"ccl:foo.lisp")
#P"/Users/alms/openmcl/ccl/foo.lisp"

? (translate-logical-pathname #p"ccl:..;foo.lisp")
#P"/Users/alms/openmcl/foo.lisp"

? (ccl::%pathname-directory #p"ccl:..;foo.lisp")
(:ABSOLUTE :UP)


But sometimes it doesn't:


? (setf (logical-pathname-translations "home")
      '((#P"home:**;*.*" #P"ccl:..;**;*.*")))
((#P"home:**;*.*" #P"ccl:..;**;*.*"))

? (translate-logical-pathname "home:foo.lisp")
  ==>> Error: Second element of absolute directory component in #P"ccl:..;foo.lisp" is :UP

and:

? (make-pathname :host "ccl" :directory '(:absolute "..")) 
  ==>> Error Second element of absolute directory component in #P"ccl:..;" is :UP


Allowing (:ABSOLUTE :UP) seems to violate the CL standard, but it's also pretty clearly useful when the host is logical.

BTW, it appears to be easy enough to make the error go away by conditionalizing the error-check in make-pathname with a call to ccl::logical-host-p. (Although there may be other places that assume this can't happen.)



More information about the Openmcl-devel mailing list