<div>[Cc. of what I sent to the comp.lang.lisp with patches attached]</div><div><br></div><div>On Nov 21, 4:18 am, <a href="mailto:p...@informatimago.com">p...@informatimago.com</a> (Pascal J. Bourguignon) wrote:</div><div>
> <a href="ftp://ftp.informatimago.com/users/pjb/lisp/check-pathnames.lisp">ftp://ftp.informatimago.com/users/pjb/lisp/check-pathnames.lisp</a></div><div>> (tests specific to MS-Windows physical paths would need to be added).</div>
<div><br></div><div>I have been working on this file and verifying whether ECL conforms to its expectations. I find that the main problem with the file is the interpretation of pathname case and more precisely, the meaning of @':local' in this context.</div>
<div><br></div><div>So, for instance, in your script (pathname-name some-logical-pathname :case :local) raises the expectation that the output should be in the case of some local filesystem. That means :local has an absolute meaning independent of the hostname. I would rather read (pathname-* any-pathname :case :local) as getting the component (*) of that pathname in the local case specified by its hostname.</div>
<div><br></div><div>If no hostname is available, then the default one. In other words, the value of :case :local when retrieving should be the value associated to that pathname's hostname (which may be the default one), and the value of :case :local when building should be the value of that pathname's hostname as specified by the arguments.</div>
<div><br></div><div>Given that you agree on this and change the script accordingly, with the patches I will be pushing up to ECL's CVS repository soon, then this implementation should conform to your expectations. See here:</div>
<div><br></div><div><br></div><div>;;; Loading "/Users/jjgarcia/build/ecl/check-pathnames.lisp"</div><div>check-pathnames of ECL (10.7.1)</div><div><br></div><div>================================================================================</div>
<div><br></div><div>Test and probe conforming logical pathnames, and their translation to</div><div>unix physical pathnames.</div><div><br></div><div>We want to check the good working of logical pathnames, and the</div><div>
translation of logical pathnames to physical pathnames, in a</div><div>semi-standard way on unix systems.</div><div><br></div><div>Namely, given the logical host and its translations:</div><div><br></div><div> (setf (logical-pathname-translations "LOGICAL") nil)</div>
<div> (setf (logical-pathname-translations "LOGICAL") </div><div> '((#P"LOGICAL:**;*.*" #P"/tmp/**/*.*")</div><div> (#P"LOGICAL:**;*" #P"/tmp/**/*")))</div>
<div><br></div><div>#P"LOGICAL:DIR;SUBDIR;NAME.TYPE.NEWEST"</div><div>must be the same as (make-pathname :host "LOGICAL"</div><div> :directory '(:absolute "DIR" "SUBDIR")</div>
<div> :name "NAME" :type "TYPE" :version :newest</div><div> :case :common)</div><div>and must translate to: #P"/tmp/dir/subdir/name.type" on unix.</div>
<div><br></div><div><br></div><div><br></div><div>Merging physical pathnames specified with :case :common is also tested:</div><div><br></div><div> (merge-pathnames (make-pathname :directory '(:relative "DIR" "SUBDIR")</div>
<div> :name "NAME" :type "TYPE" :version :newest</div><div> :case :common :default #1=#P"/tmp/")</div><div> #1# nil)</div>
<div><br></div><div>must give #P"/tmp/dir/subdir/name.type" on unix.</div><div><br></div><div>================================================================================</div><div>--------------------------------------------------------------------------------</div>
<div>Failed assertion: (IMPLY (EQL CUSTOMARY-CASE-1 :UPPER) (EQL CUSTOMARY-CASE-2 :UPPER))</div><div> with: (EQL CUSTOMARY-CASE-1 :UPPER) = T</div><div> and: (EQL CUSTOMARY-CASE-2 :UPPER) = NIL</div><div>CUSTOMARY-CASE-1 = :UPPER</div>
<div>CUSTOMARY-CASE-2 = :LOWER</div><div><br></div><div><br></div><div><br></div><div>The customary case for the file system of ECL (10.7.1) seems to be lower case.</div><div><br></div><div><br></div><div>*FEATURES* = (:UNIX :DARWIN :FORMATTER :LONG-LONG :UINT64-T :UINT32-T :UINT16-T :RELATIVE-PACKAGE-NAMES :LONG-FLOAT :UNICODE :DFFI :CLOS-STREAMS :CMU-FORMAT :ECL-PDE :DLOPEN :CLOS :BOEHM-GC :ANSI-CL :COMMON-LISP :IEEE-FLOATING-POINT :PREFIXED-API :FFI :I686 :COMMON :ECL)</div>
<div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div>================================================================================</div><div>(MAKE-PATHNAME :HOST "LOGICAL" :DEVICE :UNSPECIFIC :DIRECTORY (:ABSOLUTE "DIR" "SUBDIR") :NAME "NAME" :TYPE "TYPE" :VERSION :NEWEST :CASE :COMMON)</div>
<div><br></div><div><br></div><div>LOGICAL-PATHNAME #P"LOGICAL:DIR;SUBDIR;NAME.TYPE.NEWEST"</div><div>-------------------- :case :local (default)</div><div>Host : "LOGICAL"</div><div>Device : :UNSPECIFIC</div>
<div>Directory : (:ABSOLUTE "DIR" "SUBDIR")</div><div>Name : "NAME"</div><div>Type : "TYPE"</div><div>Version : :NEWEST</div><div>-------------------- :case :common</div>
<div>Host : "LOGICAL"</div><div>Device : :UNSPECIFIC</div><div>Directory : (:ABSOLUTE "DIR" "SUBDIR")</div><div>Name : "NAME"</div><div>Type : "TYPE"</div>
<div>Version : :NEWEST</div><div>-------------------- </div><div><br></div><div>CASE: COMMON</div><div>--------------------------------------------------------------------------------</div><div>Failed assertion: (STRING= (PATHNAME-HOST PATH :CASE :LOCAL) (POP EXPECTED-VALUES))</div>
<div> with: (PATHNAME-HOST PATH :CASE :LOCAL) = "LOGICAL"</div><div> and: (POP EXPECTED-VALUES) = "logical"</div><div>19.2.2.1.2 makes no exception for pathname-host of logical pathnames.</div><div>
--------------------------------------------------------------------------------</div><div>Failed assertion: (DIRLIST= (PATHNAME-DIRECTORY PATH :CASE :LOCAL) (POP EXPECTED-VALUES))</div><div> with: (PATHNAME-DIRECTORY PATH :CASE :LOCAL) = (:ABSOLUTE "DIR" "SUBDIR")</div>
<div> and: (POP EXPECTED-VALUES) = (:ABSOLUTE "dir" "subdir")</div><div>--------------------------------------------------------------------------------</div><div>Failed assertion: (STRING= (PATHNAME-NAME PATH :CASE :LOCAL) (POP EXPECTED-VALUES))</div>
<div> with: (PATHNAME-NAME PATH :CASE :LOCAL) = "NAME"</div><div> and: (POP EXPECTED-VALUES) = "name"</div><div>--------------------------------------------------------------------------------</div>
<div>Failed assertion: (STRING= (PATHNAME-TYPE PATH :CASE :LOCAL) (POP EXPECTED-VALUES))</div><div> with: (PATHNAME-TYPE PATH :CASE :LOCAL) = "TYPE"</div><div> and: (POP EXPECTED-VALUES) = "type"</div>
<div><br></div><div><br></div><div><br></div><div>================================================================================</div><div>(MAKE-PATHNAME :HOST "logical" :DEVICE :UNSPECIFIC :DIRECTORY (:ABSOLUTE "dir" "subdir") :NAME "name" :TYPE "type" :VERSION :NEWEST :CASE :LOCAL)</div>
<div><br></div><div><br></div><div>LOGICAL-PATHNAME #P"LOGICAL:DIR;SUBDIR;NAME.TYPE.NEWEST"</div><div>-------------------- :case :local (default)</div><div>Host : "LOGICAL"</div><div>Device : :UNSPECIFIC</div>
<div>Directory : (:ABSOLUTE "DIR" "SUBDIR")</div><div>Name : "NAME"</div><div>Type : "TYPE"</div><div>Version : :NEWEST</div><div>-------------------- :case :common</div>
<div>Host : "LOGICAL"</div><div>Device : :UNSPECIFIC</div><div>Directory : (:ABSOLUTE "DIR" "SUBDIR")</div><div>Name : "NAME"</div><div>Type : "TYPE"</div>
<div>Version : :NEWEST</div><div>-------------------- </div><div><br></div><div>CASE: LOCAL</div><div>--------------------------------------------------------------------------------</div><div>Failed assertion: (STRING= (PATHNAME-HOST PATH :CASE :LOCAL) (POP EXPECTED-VALUES))</div>
<div> with: (PATHNAME-HOST PATH :CASE :LOCAL) = "LOGICAL"</div><div> and: (POP EXPECTED-VALUES) = "logical"</div><div>19.2.2.1.2 makes no exception for pathname-host of logical pathnames.</div><div>
--------------------------------------------------------------------------------</div><div>Failed assertion: (DIRLIST= (PATHNAME-DIRECTORY PATH :CASE :LOCAL) (POP EXPECTED-VALUES))</div><div> with: (PATHNAME-DIRECTORY PATH :CASE :LOCAL) = (:ABSOLUTE "DIR" "SUBDIR")</div>
<div> and: (POP EXPECTED-VALUES) = (:ABSOLUTE "dir" "subdir")</div><div>--------------------------------------------------------------------------------</div><div>Failed assertion: (STRING= (PATHNAME-NAME PATH :CASE :LOCAL) (POP EXPECTED-VALUES))</div>
<div> with: (PATHNAME-NAME PATH :CASE :LOCAL) = "NAME"</div><div> and: (POP EXPECTED-VALUES) = "name"</div><div>--------------------------------------------------------------------------------</div>
<div>Failed assertion: (STRING= (PATHNAME-TYPE PATH :CASE :LOCAL) (POP EXPECTED-VALUES))</div><div> with: (PATHNAME-TYPE PATH :CASE :LOCAL) = "TYPE"</div><div> and: (POP EXPECTED-VALUES) = "type"</div>
<div><br></div><div>#P"/Users/jjgarcia/build/ecl/check-pathnames.lisp"</div><div><br></div><br>-- <br>Instituto de Física Fundamental, CSIC<br>c/ Serrano, 113b, Madrid 28006 (Spain) <br><a href="http://juanjose.garciaripoll.googlepages.com" target="_blank">http://juanjose.garciaripoll.googlepages.com</a><br>