From: Dr. Edmund Weitz
Subject: (logical) pathnames
Date: 
Message-ID: <m3sn8rcqkx.fsf@bird.agharta.de>
I still have problems understanding this whole (logical) pathname
concept. Unfortunately, all of the numerous Lisp books I have lying
around seem to avoid this topic like the plague (Slade mentions it
briefly but skips the hard parts), and my poor brain hasn't been able
yet to understand the definitions in the CLHS.

Here's my current problem: I wanted to install UncommonSQL on my
FreeBSD system (with CMUCL pre-18d freshly installed) and had to start
with onShore's ODCL library first. The library seems to be targeted at
Common-Lisp-Controller and seems to expect a "CL-Library" directory,
so I created the directory '/usr/local/lisp/cl-library' and put the
ODCL files in a subdirectory '/usr/local/lisp/cl-library/odcl'. I also
created a directory '/usr/local/lisp/systems' for the system
definitions of DEFSYSTEM and created a symbolic link in
'/usr/local/lisp/systems/odcl.system' which pointed to the real file
'/usr/local/lisp/cl-library/odcl/odcl.system'.

I have these forms in my .cmucl-init file: 

  (setf (ext:search-list "modules:")
        (list (ext:unix-namestring "library:subsystems/") 
              (ext:unix-namestring "library:modules/")))
  (setf (ext:search-list "cl-library:")
        '("/usr/local/lisp/cl-library/"))
  (setf (ext:search-list "systems:")
        '("/usr/local/lisp/systems/"))

Now, what happens is:

  * (load "systems:odcl.system")
  
  ; Loading #p"/usr/local/lisp/cl-library/odcl/odcl.system".
  T
  
This is what I expected and wanted to have, but then:

  * (mk:oos 'odcl :compile)

  ;    - Source file cl-library:odcl;package.lisp and binary file
  ;      cl-library:odcl;package.x86f not found, not loading.
  
  Error in function MAKE::LOAD-FILE-OPERATION:  
  Source file "cl-library:odcl;package.lisp" and binary file "cl-library:odcl;package.x86f" do not exist.
  
The file 'odcl.system' starts with 

  (setf (logical-pathname-translations "odcl")
        `(("**;*.*.*" "cl-library:;odcl;")))

  (mk:defsystem :odcl
      :source-pathname "cl-library:odcl;"

and I can solve my problem if I just change the last line to 

      :source-pathname "cl-library:odcl/"

instead. But I wonder why it doesn't work with the original system
definition. Is this an issue with CMUCL's "search list" extensions or
what else is it that I'm not understanding here?

Also, in my attempts to understand the problem I came across this
c.l.l thread
  
  <http://groups.google.com/groups?hl=en&threadm=O3fXOP3Lg1PpMrs9I3fa7zdl6EC7%404ax.com>

where some people mentioned that in a LOGICAL-PATHNAME-TRANSLATIONS
definition like above the wild-cards on both sides should match. Does
this mean that the system definiton is wrong?

Thanks for your help,
Edi.

PS: This message also sent to the CMUCL mailing list because I'm not
sure if the problem is CMUCL-specific.

From: Pierre R. Mai
Subject: Re: (logical) pathnames
Date: 
Message-ID: <87sn8q3el9.fsf@orion.bln.pmsf.de>
···@agharta.de (Dr. Edmund Weitz) writes:

>   (setf (ext:search-list "cl-library:")
>         '("/usr/local/lisp/cl-library/"))

[...]

>   ;    - Source file cl-library:odcl;package.lisp and binary file
>   ;      cl-library:odcl;package.x86f not found, not loading.
>   
>   Error in function MAKE::LOAD-FILE-OPERATION:  
>   Source file "cl-library:odcl;package.lisp" and binary file "cl-library:odcl;package.x86f" do not exist.
>   
> The file 'odcl.system' starts with 
> 
>   (setf (logical-pathname-translations "odcl")
>         `(("**;*.*.*" "cl-library:;odcl;")))

[ Aside:  That definition is a bit strange, in that it maps to a
relative logical pathname (the first ; on the right-hand side).  I'm
not certain that that is either useful or sensible ]

>   (mk:defsystem :odcl
>       :source-pathname "cl-library:odcl;"
> 
> and I can solve my problem if I just change the last line to 
> 
>       :source-pathname "cl-library:odcl/"
> 
> instead. But I wonder why it doesn't work with the original system
> definition. Is this an issue with CMUCL's "search list" extensions or
> what else is it that I'm not understanding here?

It doesn't work with the original definition, because that assumes
that cl-library is a logical pathname host, so it uses
logical-pathname syntax (e.g. ; to separate directories, etc.).  OTOH
you defined cl-library as a CMU CL search-list.  search-lists are
normal unix-pathnames, and hence use unix-pathname syntax (e.g. / to
separate directories, etc.).

> Also, in my attempts to understand the problem I came across this
> c.l.l thread
>   
>   <http://groups.google.com/groups?hl=en&threadm=O3fXOP3Lg1PpMrs9I3fa7zdl6EC7%404ax.com>
> 
> where some people mentioned that in a LOGICAL-PATHNAME-TRANSLATIONS
> definition like above the wild-cards on both sides should match. Does
> this mean that the system definiton is wrong?

I'm not 100% sure that that's the requirement (in other words: I'm too
lazy to reread the relevant sections of the CLHS), but generally that
is good advice, and seems to work best with most implementations.

Regs, Pierre.

-- 
Pierre R. Mai <····@acm.org>                    http://www.pmsf.de/pmai/
 The most likely way for the world to be destroyed, most experts agree,
 is by accident. That's where we come in; we're computer professionals.
 We cause accidents.                           -- Nathaniel Borenstein
From: Dr. Edmund Weitz
Subject: Re: (logical) pathnames
Date: 
Message-ID: <m3lmeipsrz.fsf@dyn138.dbdmedia.de>
"Pierre R. Mai" <····@acm.org> writes:

> It doesn't work with the original definition, because that assumes
> that cl-library is a logical pathname host, so it uses
> logical-pathname syntax (e.g. ; to separate directories, etc.).
> OTOH you defined cl-library as a CMU CL search-list.  search-lists
> are normal unix-pathnames, and hence use unix-pathname syntax
> (e.g. / to separate directories, etc.).

That was the information that I needed (and also got from Paul Foley
by private email). I've changed my setup and was now able to build
ODCL and UncommonSQL on FreeBSD without using c-l-c (or rather trying
to imitate it).

Thanks,
Edi.
From: Marco Antoniotti
Subject: Re: (logical) pathnames
Date: 
Message-ID: <y6cadupszei.fsf@octagon.mrl.nyu.edu>
"Pierre R. Mai" <····@acm.org> writes:

> ···@agharta.de (Dr. Edmund Weitz) writes:
> 
> >   (setf (ext:search-list "cl-library:")
> >         '("/usr/local/lisp/cl-library/"))
> 
> [...]
> 
> >   ;    - Source file cl-library:odcl;package.lisp and binary file
> >   ;      cl-library:odcl;package.x86f not found, not loading.
> >   
> >   Error in function MAKE::LOAD-FILE-OPERATION:  
> >   Source file "cl-library:odcl;package.lisp" and binary file "cl-library:odcl;package.x86f" do not exist.
> >   
> > The file 'odcl.system' starts with 
> > 
> >   (setf (logical-pathname-translations "odcl")
> >         `(("**;*.*.*" "cl-library:;odcl;")))
> 
> [ Aside:  That definition is a bit strange, in that it maps to a
> relative logical pathname (the first ; on the right-hand side).  I'm
> not certain that that is either useful or sensible ]
> 
> >   (mk:defsystem :odcl
> >       :source-pathname "cl-library:odcl;"
> > 
> > and I can solve my problem if I just change the last line to 
> > 
> >       :source-pathname "cl-library:odcl/"
> > 
> > instead. But I wonder why it doesn't work with the original system
> > definition. Is this an issue with CMUCL's "search list" extensions or
> > what else is it that I'm not understanding here?
> 
> It doesn't work with the original definition, because that assumes
> that cl-library is a logical pathname host, so it uses
> logical-pathname syntax (e.g. ; to separate directories, etc.).  OTOH
> you defined cl-library as a CMU CL search-list.  search-lists are
> normal unix-pathnames, and hence use unix-pathname syntax (e.g. / to
> separate directories, etc.).

As an aside.  If you use CMUCL search lists, you are writing
unportable code.

Cheers

-- 
Marco Antoniotti ========================================================
NYU Courant Bioinformatics Group        tel. +1 - 212 - 998 3488
719 Broadway 12th Floor                 fax  +1 - 212 - 995 4122
New York, NY 10003, USA                 http://bioinformatics.cat.nyu.edu
                    "Hello New York! We'll do what we can!"
                           Bill Murray in `Ghostbusters'.