[Cc. of what I sent to the comp.lang.lisp with patches attached] On Nov 21, 4:18 am, p...@informatimago.com (Pascal J. Bourguignon) wrote: > ftp://ftp.informatimago.com/users/pjb/lisp/check-pathnames.lisp > (tests specific to MS-Windows physical paths would need to be added).
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. 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. 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. 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: ;;; Loading "/Users/jjgarcia/build/ecl/check-pathnames.lisp" check-pathnames of ECL (10.7.1) ================================================================================ Test and probe conforming logical pathnames, and their translation to unix physical pathnames. We want to check the good working of logical pathnames, and the translation of logical pathnames to physical pathnames, in a semi-standard way on unix systems. Namely, given the logical host and its translations: (setf (logical-pathname-translations "LOGICAL") nil) (setf (logical-pathname-translations "LOGICAL") '((#P"LOGICAL:**;*.*" #P"/tmp/**/*.*") (#P"LOGICAL:**;*" #P"/tmp/**/*"))) #P"LOGICAL:DIR;SUBDIR;NAME.TYPE.NEWEST" must be the same as (make-pathname :host "LOGICAL" :directory '(:absolute "DIR" "SUBDIR") :name "NAME" :type "TYPE" :version :newest :case :common) and must translate to: #P"/tmp/dir/subdir/name.type" on unix. Merging physical pathnames specified with :case :common is also tested: (merge-pathnames (make-pathname :directory '(:relative "DIR" "SUBDIR") :name "NAME" :type "TYPE" :version :newest :case :common :default #1=#P"/tmp/") #1# nil) must give #P"/tmp/dir/subdir/name.type" on unix. ================================================================================ -------------------------------------------------------------------------------- Failed assertion: (IMPLY (EQL CUSTOMARY-CASE-1 :UPPER) (EQL CUSTOMARY-CASE-2 :UPPER)) with: (EQL CUSTOMARY-CASE-1 :UPPER) = T and: (EQL CUSTOMARY-CASE-2 :UPPER) = NIL CUSTOMARY-CASE-1 = :UPPER CUSTOMARY-CASE-2 = :LOWER The customary case for the file system of ECL (10.7.1) seems to be lower case. *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) ================================================================================ (MAKE-PATHNAME :HOST "LOGICAL" :DEVICE :UNSPECIFIC :DIRECTORY (:ABSOLUTE "DIR" "SUBDIR") :NAME "NAME" :TYPE "TYPE" :VERSION :NEWEST :CASE :COMMON) LOGICAL-PATHNAME #P"LOGICAL:DIR;SUBDIR;NAME.TYPE.NEWEST" -------------------- :case :local (default) Host : "LOGICAL" Device : :UNSPECIFIC Directory : (:ABSOLUTE "DIR" "SUBDIR") Name : "NAME" Type : "TYPE" Version : :NEWEST -------------------- :case :common Host : "LOGICAL" Device : :UNSPECIFIC Directory : (:ABSOLUTE "DIR" "SUBDIR") Name : "NAME" Type : "TYPE" Version : :NEWEST -------------------- CASE: COMMON -------------------------------------------------------------------------------- Failed assertion: (STRING= (PATHNAME-HOST PATH :CASE :LOCAL) (POP EXPECTED-VALUES)) with: (PATHNAME-HOST PATH :CASE :LOCAL) = "LOGICAL" and: (POP EXPECTED-VALUES) = "logical" 19.2.2.1.2 makes no exception for pathname-host of logical pathnames. -------------------------------------------------------------------------------- Failed assertion: (DIRLIST= (PATHNAME-DIRECTORY PATH :CASE :LOCAL) (POP EXPECTED-VALUES)) with: (PATHNAME-DIRECTORY PATH :CASE :LOCAL) = (:ABSOLUTE "DIR" "SUBDIR") and: (POP EXPECTED-VALUES) = (:ABSOLUTE "dir" "subdir") -------------------------------------------------------------------------------- Failed assertion: (STRING= (PATHNAME-NAME PATH :CASE :LOCAL) (POP EXPECTED-VALUES)) with: (PATHNAME-NAME PATH :CASE :LOCAL) = "NAME" and: (POP EXPECTED-VALUES) = "name" -------------------------------------------------------------------------------- Failed assertion: (STRING= (PATHNAME-TYPE PATH :CASE :LOCAL) (POP EXPECTED-VALUES)) with: (PATHNAME-TYPE PATH :CASE :LOCAL) = "TYPE" and: (POP EXPECTED-VALUES) = "type" ================================================================================ (MAKE-PATHNAME :HOST "logical" :DEVICE :UNSPECIFIC :DIRECTORY (:ABSOLUTE "dir" "subdir") :NAME "name" :TYPE "type" :VERSION :NEWEST :CASE :LOCAL) LOGICAL-PATHNAME #P"LOGICAL:DIR;SUBDIR;NAME.TYPE.NEWEST" -------------------- :case :local (default) Host : "LOGICAL" Device : :UNSPECIFIC Directory : (:ABSOLUTE "DIR" "SUBDIR") Name : "NAME" Type : "TYPE" Version : :NEWEST -------------------- :case :common Host : "LOGICAL" Device : :UNSPECIFIC Directory : (:ABSOLUTE "DIR" "SUBDIR") Name : "NAME" Type : "TYPE" Version : :NEWEST -------------------- CASE: LOCAL -------------------------------------------------------------------------------- Failed assertion: (STRING= (PATHNAME-HOST PATH :CASE :LOCAL) (POP EXPECTED-VALUES)) with: (PATHNAME-HOST PATH :CASE :LOCAL) = "LOGICAL" and: (POP EXPECTED-VALUES) = "logical" 19.2.2.1.2 makes no exception for pathname-host of logical pathnames. -------------------------------------------------------------------------------- Failed assertion: (DIRLIST= (PATHNAME-DIRECTORY PATH :CASE :LOCAL) (POP EXPECTED-VALUES)) with: (PATHNAME-DIRECTORY PATH :CASE :LOCAL) = (:ABSOLUTE "DIR" "SUBDIR") and: (POP EXPECTED-VALUES) = (:ABSOLUTE "dir" "subdir") -------------------------------------------------------------------------------- Failed assertion: (STRING= (PATHNAME-NAME PATH :CASE :LOCAL) (POP EXPECTED-VALUES)) with: (PATHNAME-NAME PATH :CASE :LOCAL) = "NAME" and: (POP EXPECTED-VALUES) = "name" -------------------------------------------------------------------------------- Failed assertion: (STRING= (PATHNAME-TYPE PATH :CASE :LOCAL) (POP EXPECTED-VALUES)) with: (PATHNAME-TYPE PATH :CASE :LOCAL) = "TYPE" and: (POP EXPECTED-VALUES) = "type" #P"/Users/jjgarcia/build/ecl/check-pathnames.lisp" -- Instituto de FĂsica Fundamental, CSIC c/ Serrano, 113b, Madrid 28006 (Spain) http://juanjose.garciaripoll.googlepages.com
ecl-path.diff
Description: Binary data
------------------------------------------------------------------------------ Increase Visibility of Your 3D Game App & Earn a Chance To Win $500! Tap into the largest installed PC base & get more eyes on your game by optimizing for Intel(R) Graphics Technology. Get started today with the Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs. http://p.sf.net/sfu/intelisp-dev2dev
_______________________________________________ Ecls-list mailing list Ecls-list@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ecls-list