Re: The Logical Pathname (Song)

Martin Simmons <[email protected]>
Newsgroups gmane.lisp.lispworks.general
Message-ID <[email protected]>
OK, so LW and SBCL agree on the correct answer :-)

The reason I think this is correct is because logical pathname syntax uses a
semicolon prefix to denote a relative pathname (this is the opposite of Unix
and Windows filenames that use a slash prefix to denote absolute).

As a result, "ASD.F" is parsed as an absolute logical pathname.  If you want a
relative logical pathname then you need to use ";ASD.F" instead.

-- 
Martin Simmons
LispWorks Ltd
http://www.lispworks.com/



>>>>> On Fri, 13 Mar 2026 21:04:26 +0100, Marco Antoniotti (as marco dot antoniotti at unimib dot it) said:
> 
> This is CCL
> 
> CL-USER> (describe (merge-pathnames "ASD.F" "LP:FOO;QWE;"))
> #P"LP:FOO;QWE;ASD.F.newest"
> Type: LOGICAL-PATHNAME
> Class: #<BUILT-IN-CLASS LOGICAL-PATHNAME>
> TYPE: (LOGICAL-PATHNAME . #<CCL::CLASS-WRAPPER LOGICAL-PATHNAME
> #x30004003C6ED>)
> 1: (:ABSOLUTE "FOO" "QWE")
> 2: "ASD"
> 3: "F"
> %LOGICAL-PATHNAME-HOST: "LP"
> %LOGICAL-PATHNAME-VERSION: :NEWEST
> ; No value
> 
> CL-USER> (describe (merge-pathnames "" "LP:FOO;QWE;"))
> #P"LP:FOO;QWE;..newest"
> Type: LOGICAL-PATHNAME
> Class: #<BUILT-IN-CLASS LOGICAL-PATHNAME>
> TYPE: (LOGICAL-PATHNAME . #<CCL::CLASS-WRAPPER LOGICAL-PATHNAME
> #x30004003C6ED>)
> 1: (:ABSOLUTE "FOO" "QWE")
> 2: NIL
> 3: NIL
> %LOGICAL-PATHNAME-HOST: "LP"
> %LOGICAL-PATHNAME-VERSION: :NEWEST
> ; No value
> CL-USER>
> 
> 
> This is ECL (not very useful)
> 
> CL-USER> (describe (merge-pathnames "ASD.F" "LP:FOO;QWE;"))
> 
> #P"LP:FOO;QWE;ASD.F.NEWEST" - LOGICAL-PATHNAME
> ; No value
> CL-USER> (describe (merge-pathnames "" "LP:FOO;QWE;"))
> 
> #P"LP:FOO;QWE;.NEWEST" - LOGICAL-PATHNAME
> ; No value
> CL-USER>
> 
> 
> This is SBCL
> 
> CL-USER> (describe (merge-pathnames "ASD.F" "LP:FOO;QWE;"))
> #P"LP:ASD.F.NEWEST"
>   [logical-pathname]
> 
>   HOST       = #<SB-KERNEL:LOGICAL-HOST "LP">
>   DEVICE     = :UNSPECIFIC
>   DIRECTORY  = (:ABSOLUTE)
>   NAME       = "ASD"
>   TYPE       = "F"
>   VERSION    = :NEWEST
> ; No value
> 
> CL-USER> (describe (merge-pathnames "" "LP:FOO;QWE;"))
> #<LOGICAL-PATHNAME (with no namestring)..
>   [logical-pathname]
> 
>   HOST       = #<SB-KERNEL:LOGICAL-HOST "LP">
>   DEVICE     = :UNSPECIFIC
>   DIRECTORY  = (:ABSOLUTE)
>   VERSION    = :NEWEST
> ; No value
> 
> 
> ... and finally, LWM
> 
> CL-USER 65 > (describe (merge-pathnames "ASD.F" "LP:FOO;QWE;"))
> 
> #P"LP:ASD.F.NEWEST" is a LOGICAL-PATHNAME
> HOST           "LP"
> DEVICE         :UNSPECIFIC
> DIRECTORY      (:ABSOLUTE)
> NAME           "ASD"
> TYPE           "F"
> VERSION        :NEWEST
> 
> CL-USER 68 > (describe (merge-pathnames "" "LP:FOO;QWE;"))
> 
> #P"LP:" is a LOGICAL-PATHNAME
> HOST           "LP"
> DEVICE         :UNSPECIFIC
> DIRECTORY      (:ABSOLUTE)
> NAME           NIL
> TYPE           NIL
> VERSION        :NEWEST
> 
> CLs are not logical, Spok.
> 
> MA
> 
> 
> 
> 
> 
> 
> On Fri, Mar 13, 2026 at 8:50 PM Robert Goldman <[email protected]> wrote:
> 
> > Maybe call DESCRIBE on each of these so we can see what's in each one in
> > full detail?
> >
> > On 13 Mar 2026, at 14:40, Marco Antoniotti (as marco dot antoniotti at
> > unimib dot it) wrote:
> >
> > This is CCL
> >
> >
> > CL-USER>
> > (setf (logical-pathname-translations "LP")                '(("**;*.*.*"
> > "~/Projects/Foo/Bar/**/")))
> > (("**;*.*.*" "~/Projects/Foo/Bar/**/"))
> > CL-USER> (merge-pathnames "ASD.F" "LP:FOO;QWE;")
> > #P"LP:FOO;QWE;ASD.F.newest"
> > CL-USER> (merge-pathnames "" "LP:FOO;QWE;")
> > #P"LP:FOO;QWE;..newest"
> > CL-USER>
> >
> >
> > This is ECL
> >
> > CL-USER>
> > (setf (logical-pathname-translations "LP")                '(("**;*.*.*"
> > "~/Projects/Foo/Bar/**/")))*
> > ((#P"LP:**;*.*.*" #P"/Users/marcoxa/Projects/Foo/Bar/**/"))
> > CL-USER>  (merge-pathnames "ASD.F" "LP:FOO;QWE;")
> > #P"LP:FOO;QWE;ASD.F.NEWEST"
> > CL-USER>  (merge-pathnames "" "LP:FOO;QWE;")
> > #P"LP:FOO;QWE;.NEWEST"
> > CL-USER>
> >
> > This is SBCL
> >
> > CL-USER>
> > (setf (logical-pathname-translations "LP")                '(("**;*.*.*"
> > "~/Projects/Foo/Bar/**/")))
> > (("**;*.*.*" "~/Projects/Foo/Bar/**/"))
> > CL-USER> (merge-pathnames "ASD.F" "LP:FOO;QWE;")
> > #P"LP:ASD.F.NEWEST"
> > CL-USER> (merge-pathnames "" "LP:FOO;QWE;")
> > #<LOGICAL-PATHNAME (with no namestring)
> >                    :HOST #<SB-KERNEL:LOGICAL-HOST "LP">
> >                    :DEVICE :UNSPECIFIC
> >                    :DIRECTORY (:ABSOLUTE)
> >                    :NAME NIL
> >                    :TYPE NIL
> >                    :VERSION :NEWEST>
> > CL-USER>
> >
> > This is LWM (same setup)
> >
> > CL-USER 61 > (merge-pathnames "ASD.F" "LP:FOO;QWE;")
> > #P"LP:ASD.F.NEWEST"
> >
> > CL-USER 62 > (merge-pathnames "" "LP:FOO;QWE;")
> > #P"LP:"
> >
> > CL-USER 63 >
> >
> > As you see there isn't much... logic in the results. 🙄
> >
> > Cheers
> >
> > MA
> >
> >
> >
> > On Fri, Mar 13, 2026 at 7:36 PM Martin Simmons <[email protected]>
> > wrote:
> >
> >> It looks correct to me.  What are other CL's doing differently?
> >>
> >> --
> >> Martin Simmons
> >> LispWorks Ltd
> >> http://www.lispworks.com/
> >>
> >>
> >>
> >> >>>>> On Wed, 11 Mar 2026 19:54:07 +0100, Marco Antoniotti (as marco dot
> >> antoniotti at unimib dot it) said:
> >> >
> >> > Hi
> >> >
> >> > I have the following
> >> >
> >> > CL-USER 225 >
> >> > (setf (logical-pathname-translations "LP")
> >> > '(("**;*.*.*" "~/Projects/Foo/Bar/**/")))
> >> > (("**;*.*.*" "~/Projects/Foo/Bar/**/"))
> >> >
> >> > Then
> >> >
> >> > CL-USER 256 > (merge-pathnames "ASD.F" "LP:FOO;QWE;")
> >> > #P"LP:ASD.F.NEWEST"
> >> >
> >> > Which is ... different from what other CL's do.
> >> >
> >> > Any hermeneutics about this in LW?
> >> >
> >> > Cheers
> >> > MA
> >> >
> >> >
> >> > --
> >> > Marco Antoniotti, Professor, Director         tel. +39 - 02 64 48 79 01
> >> > DISCo, University of Milan-Bicocca U14 2043
> >> http://dcb.disco.unimib.it
> >> > Viale Sarca 336
> >> > I-20126 Milan (MI) ITALY
> >> >
> >> > REGAINS: https://regains.disco.unimib.it/
> >> >
> >>
> >
> >
> > --
> > Marco Antoniotti, Professor, Director         tel. +39 - 02 64 48 79 01
> > DISCo, University of Milan-Bicocca U14 2043   http://dcb.disco.unimib.it
> > Viale Sarca 336
> > I-20126 Milan (MI) ITALY
> >
> > REGAINS: https://regains.disco.unimib.it/
> >
> >
> 
> -- 
> Marco Antoniotti, Professor, Director         tel. +39 - 02 64 48 79 01
> DISCo, University of Milan-Bicocca U14 2043   http://dcb.disco.unimib.it
> Viale Sarca 336
> I-20126 Milan (MI) ITALY
> 
> REGAINS: https://regains.disco.unimib.it/
> 

_______________________________________________
Lisp Hug - the mailing list for LispWorks users
[email protected]
http://www.lispworks.com/support/lisp-hug.html
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.