Subject: Re: Logical pathname hosts.
From: Erik Naggum <erik@naggum.no>
Date: 1998/12/22
Newsgroups: comp.lang.lisp
Message-ID: <3123281615303079@naggum.no>

* Raymond Toy <toy@rtp.ericsson.se>
| You're right.  That doesn't work in CMUCL.  As a work-around you can use
| this instead, which should work for both CMUCL and ACL:
| 
| * (setf (logical-pathname-translations "source")
|    '(("demos;**;*.*"  "/home/rmiles/code/lisp/source/demos/")
|      ("demos;**;*.*" "/home/rmiles/code/lisp/source/demos/")))
| 
| * (translate-logical-pathname "source:demos;foo.lisp")
| #p"/home/rmiles/code/lisp/source/demos/foo.lisp"
| 
| The question is: is the example Erik gave the correct ANSI interpretation
| of the logical pathname?  If so, I'll make a note of it and try to fix it
| some day.

  I must admit that I don't understand the difference between your example
  and mine.  (except, that yours works on CMUCL and mine doesn't, but that
  leads me to believe in the bug that stole christmas.)

  let host be (pathname-host (parse-namestring (format nil "~A:" string))).
  now, the standard says that the first element in each list in the list of
  translations shall be parsable by (parse-namestring string host) if it is
  a logical pathname namestring (as opposed to logical pathname whose host
  is host).  this leads me to assume that there is a difference between the
  behavior of CMUCL and ACL for these three forms:

(parse-namestring "**;*.*" host)
(parse-namestring ";**;*.*" host)
(parse-namestring "demos;**;*.*" host)

  in Allegro CL 5.0 (with my patches to bring directory components in line,
  but that is immaterial here except that you won't get identical results):

NAGGUM(20): (defvar host (pathname-host (parse-namestring "source:")))
host
NAGGUM(21): (setf (logical-pathname-translations host) nil)
nil
NAGGUM(22): (describe (parse-namestring "**;*.*" host))
#p"source:**;*.*" is a structure of type logical-pathname.  It has these slots:
 host               "source"
 device             nil
 directory          (:absolute :wild-inferiors)
 name               :wild
 type               :wild
 version            nil
 namestring         nil
 hash               nil
 dir-namestring     "**/"
NAGGUM(23): (describe (parse-namestring ";**;*.*" host))
#p"source:;**;*.*" is a structure of type logical-pathname.  It has these slots:
 host               "source"
 device             nil
 directory          (:relative :wild-inferiors)
 name               :wild
 type               :wild
 version            nil
 namestring         nil
 hash               nil
 dir-namestring     "**/"
NAGGUM(24): (describe (parse-namestring "demos;**;*.*" host))
#p"source:demos;**;*.*" is a structure of type logical-pathname.  It has these
slots:
 host               "source"
 device             nil
 directory          (:absolute "demos" :wild-inferiors)
 name               :wild
 type               :wild
 version            nil
 namestring         nil
 hash               nil
 dir-namestring     "/demos/**/"

  this appears to be completely in line with the specification.

  I'd like to hear the evidence you found that it was not, and also your
  theories on why it supposedly helped CMUCL to have a non-wild first
  directory component.
  
| Erik's example also fails on CLISP.

  frankly, I'd like to know when what I think is right doesn't fail on
  CLISP.  until then, failing is the default condition, hardly worth any
  mention at all.

#:Erik
-- 
  Nie wieder KrF!  Nie wieder KrF!  Nie wieder KrF!  Nie wieder KrF!