[pjb@kuiper :0.0 ~]$ lisp -noinit
CMU Common Lisp 19c (19C), running on kuiper
With core: /data/languages/cmucl-19c/lib/cmucl/lib/lisp.core
Dumped on: Thu, 2005-11-17 15:12:58+01:00 on lorien
See <http://www.cons.org/cmucl/> for support information.
Loaded subsystems:
    Python 1.1, target Intel x86
    CLOS based on Gerd's PCL 2004/04/14 03:32:47
* (load "/home/pjb/src/lisp/check-pathnames.lisp")

; Loading #P"/home/pjb/src/lisp/check-pathnames.lisp".

================================================================================

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".

================================================================================
The customary case for the file system of CMU Common Lisp (19c (19C)) is upper
case.
--------------------------------------------------------------------------------
Failed assertion: (EQL *CUSTOMARY-CASE* :LOWER)
   with: *CUSTOMARY-CASE* = :UPPER
    and: :LOWER = :LOWER
99% of the unix path names are entirely lower case, so the customary case for
an implementation on unix should be lower case.

================================================================================
(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
--------------------
--------------------------------------------------------------------------------
Failed assertion: (STRING= EXPECTED-PRINTED
                           (PRIN1-TO-STRING PATH)
                           :END2 (LENGTH EXPECTED-PRINTED))
   with: EXPECTED-PRINTED = "#P\"LOGICAL:DIR;SUBDIR;NAME.TYPE\""
    and: (PRIN1-TO-STRING PATH) = "#P\"LOGICAL:DIR;SUBDIR;NAME.TYPE.NEWEST\""

It would be better if logical pathnames were printed using upper case
letters, mostly because of 19.3.1.1.7, and because:

    22.1.1 Overview of The Lisp Printer

    Reading a printed representation typically produces an object that is
    equal to the originally printed object.

and

    2.4.8.14 Sharpsign P

    #P reads a following object, which must be a string.

    #P<<expression>> is equivalent to #.(parse-namestring '<<expression>>),
    except that #P is not affected by *read-eval*.

and

    Function PARSE-NAMESTRING

    * If host is nil and thing is a syntactically valid logical pathname
      namestring containing an explicit host, then it is parsed as a
      logical pathname namestring.

and

    19.3.1.1.7 Lowercase Letters in a Logical Pathname Namestring
    When parsing words and wildcard-words, lowercase letters are translated to uppercase.

Notice that means that a logical pathname built with mixed cases (or
lower case), cannot be printed readably with a conforming syntax (but
it doesn't matter, since it's not a conforming logical pathname
anyways).



================================================================================
(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
--------------------
--------------------------------------------------------------------------------
Failed assertion: (STRING= (PATHNAME-HOST PATH :CASE :COMMON)
                           (POP EXPECTED-VALUES))
   with: (PATHNAME-HOST PATH :CASE :COMMON) = "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 :COMMON)
                            (POP EXPECTED-VALUES))
   with: (PATHNAME-DIRECTORY PATH :CASE :COMMON) = (:ABSOLUTE "DIR" "SUBDIR")
    and: (POP EXPECTED-VALUES) = (:ABSOLUTE "dir" "subdir")
--------------------------------------------------------------------------------
Failed assertion: (STRING= (PATHNAME-NAME PATH :CASE :COMMON)
                           (POP EXPECTED-VALUES))
   with: (PATHNAME-NAME PATH :CASE :COMMON) = "NAME"
    and: (POP EXPECTED-VALUES) = "name"
--------------------------------------------------------------------------------
Failed assertion: (STRING= (PATHNAME-TYPE PATH :CASE :COMMON)
                           (POP EXPECTED-VALUES))
   with: (PATHNAME-TYPE PATH :CASE :COMMON) = "TYPE"
    and: (POP EXPECTED-VALUES) = "type"
--------------------------------------------------------------------------------
Failed assertion: (STRING= EXPECTED-PRINTED
                           (PRIN1-TO-STRING PATH)
                           :END2 (LENGTH EXPECTED-PRINTED))
   with: EXPECTED-PRINTED = "#P\"LOGICAL:DIR;SUBDIR;NAME.TYPE\""
    and: (PRIN1-TO-STRING PATH) = "#P\"LOGICAL:DIR;SUBDIR;NAME.TYPE.NEWEST\""

It would be better if logical pathnames were printed using upper case
letters, mostly because of 19.3.1.1.7, and because:

    22.1.1 Overview of The Lisp Printer

    Reading a printed representation typically produces an object that is
    equal to the originally printed object.

and

    2.4.8.14 Sharpsign P

    #P reads a following object, which must be a string.

    #P<<expression>> is equivalent to #.(parse-namestring '<<expression>>),
    except that #P is not affected by *read-eval*.

and

    Function PARSE-NAMESTRING

    * If host is nil and thing is a syntactically valid logical pathname
      namestring containing an explicit host, then it is parsed as a
      logical pathname namestring.

and

    19.3.1.1.7 Lowercase Letters in a Logical Pathname Namestring
    When parsing words and wildcard-words, lowercase letters are translated to uppercase.

Notice that means that a logical pathname built with mixed cases (or
lower case), cannot be printed readably with a conforming syntax (but
it doesn't matter, since it's not a conforming logical pathname
anyways).

T
* (quit)
[pjb@kuiper :0.0 ~]$
ViewGit