Subject: [clisp-list] logical pathnames in clisp 2000-03-06 ?

From: [email-masked] (Don Cohen)
Date: Wed, 3 May 2000 23:56:55 -0700

Am I doing something wrong or are logical pathnames still not working?

uname -a
SunOS isis.compsvcs.com 5.5.1 Generic sun4m sparc SUNW,SPARCstation-5

[1]> (lisp-implementation-version)
"2000-03-06 (March 2000)"
[2]> (logical-pathname-translations "sys")
((#S(LOGICAL-PATHNAME :HOST "SYS" :DEVICE NIL :DIRECTORY (:RELATIVE)
       :NAME :WILD :TYPE "LISP" :VERSION NIL
    )
    "*.lsp"
 )
  (#S(LOGICAL-PATHNAME :HOST "SYS" :DEVICE NIL :DIRECTORY (:ABSOLUTE)
       :NAME :WILD :TYPE :WILD :VERSION NIL
     )
    "*.*"
  )
  (#S(LOGICAL-PATHNAME :HOST "SYS" :DEVICE NIL :DIRECTORY (:ABSOLUTE)
       :NAME :WILD :TYPE NIL :VERSION NIL
     )
    "*"
) )
[3]> (translate-logical-pathname "sys:foo.bar")

*** - TRANSLATE-PATHNAME: replacement pieces ("foo" "bar" NIL) do not fit into #P"*.*"
1. Break [4]> (setf (logical-pathname-translations "Don")
  '((";**;*.*" "/export/home/donc/lisp/")
    ("**;*.*" "/export/home/donc/lisp/")))
((#S(LOGICAL-PATHNAME :HOST "DON" :DEVICE NIL
       :DIRECTORY (:RELATIVE :WILD-INFERIORS) :NAME :WILD :TYPE :WILD
       :VERSION NIL
    )
    "/export/home/donc/lisp/"
 )
  (#S(LOGICAL-PATHNAME :HOST "DON" :DEVICE NIL
       :DIRECTORY (:ABSOLUTE :WILD-INFERIORS) :NAME :WILD :TYPE :WILD
       :VERSION NIL
     )
    "/export/home/donc/lisp/"
) )
1. Break [4]> (translate-logical-pathname "don:foo.bar")

*** - TRANSLATE-PATHNAME: replacement pieces ((:DIRECTORY) "foo" "bar" NIL) do not fit into #P"/export/home/donc/lisp/"
2. Break [5]>

---

From: Sam Steingold <[email-masked]>
Date: 18 May 2000 14:04:43 -0400

>>>> In message <[email-masked].>
>>>> On the subject of "[clisp-list] logical pathnames in clisp 2000-03-06 ?"
>>>> Sent on Thu May 04 01:49:47 EDT 2000
>>>> Honorable Don Cohen <[email-masked]> writes:

I don't know why CLISP defines this logical host.  (the only reason I
could see is to make "LISP" equivalent to "lisp" as filename
extensions.)
Bruno?

 >> [4]> (setf (logical-pathname-translations "Don")

your fault, it should be

(setf (logical-pathname-translations "Don")
      '(("**;*.*" "/export/home/donc/lisp/**/*")))

(I don't know what the leading ';' is for, but I am not a logical
pathname expert).

-- 
Sam Steingold (http://www.podval.org/~sds)
Micros**t is not the answer.  Micros**t is a question, and the answer is Linux,
(http://www.linux.org) the choice of the GNU (http://www.gnu.org) generation.
All extremists should be taken out and shot.

---

From: [email-masked] (Don Cohen)
Date: Thu, 18 May 2000 11:19:45 -0700 (PDT)

your fault, it should be

Well, what I should have written in this case was /export/.../lisp/*.* 
I was HOPING to ignore the **, i.e., don:foo.bar and don:x;y;z;foo.bar
both translate to /export/.../lisp/foo.bar
Similarly, I'd like to be able to leave out the *.*, as in
/export/.../lisp/foo in which case the filename and extension would
also not matter.  Or even /export/.../lisp/*.lsp or fum.* in order
to get foo.bar to translate to foo.lsp or fum.bar !

Does this make sense?

The leading ; is to allow for translations of relative paths.

---

From: Bruno Haible <[email-masked]>
Date: Thu, 18 May 2000 20:39:51 +0200 (MET DST)

> could see is to make "LISP" equivalent to "lisp" as filename

CLtL2 and CLHS say
   The logical pathname host name "SYS" is reserved for the implementation.
   The existence and meaning of SYS: logical pathnames is implementation-
   defined.

I thought it was good style to define such a logical host; at least it
makes it possible to test something :-)

> (I don't know what the leading ';' is for, but I am not a logical

"If a semicolon precedes the directories, the directory component is
relative; otherwise it is absolute."

Bruno

---

From: Bruno Haible <[email-masked]>
Date: Thu, 18 May 2000 20:44:26 +0200 (MET DST)

Don Cohen writes:
>   it should be

It doesn't work this way in clisp, because throwing away wild directory
components doesn't seem useful to me. (Imagine all index.html files on your
preferred webserver being copied to a single place...)

Bruno