Re: The Logical Pathname (Song)

"Rainer Joswig (as joswig at lisp dot de)" <[email protected]>
Newsgroups gmane.lisp.lispworks.general
Message-ID <[email protected]>
Okay, we need to infer that this is about the pathname argument. Which kind of makes sense.


a) the namestring "ASD.F" will be parsed as a logical pathname inside MERGE-PATHNAMES

CL-USER 18 > (merge-pathnames "ASD.F" "LP:FOO;QWE;")
#P"LP:ASD.F.NEWEST"



b) the namestring "ASD.F" will be parsed as a PATHNAME (unless *default-pathname-defaults* is a LOGICAL-PATHNAME).

CL-USER 19 > (merge-pathnames (parse-namestring "ASD.F") "LP:FOO;QWE;")
#P"LP:FOO;QWE;ASD.F.NEWEST"


Also: 


CL-USER 28 > (let ((*default-pathname-defaults* #p""))
               (pathname "ASD.F"))
#P"ASD.F"

CL-USER 29 > (let ((*default-pathname-defaults* "LP:FOO;QWE;"))
               (pathname "ASD.F"))
#P"LP:ASD.F"



Given that, I'd think SBCL and LispWorks have the correct result.

Regards,

Rainer


> Am 13.03.2026 um 22:15 schrieb Martin Simmons <[email protected]>:
> 
> Because the spec for merge-pathnames says it is in this case:
> 
> "merge-pathnames recognizes a logical pathname namestring when
> default-pathname is a logical pathname, or when the namestring begins with the
> name of a defined logical host followed by a colon. In the first of these two
> cases, the host portion of the logical pathname namestring and its following
> colon are optional."
> 
> -- 
> Martin Simmons
> LispWorks Ltd
> http://www.lispworks.com/
> 
> 
> 
>>>>>> On Fri, 13 Mar 2026 21:52:15 +0100, Rainer Joswig (as joswig at lisp dot de) said:
>> 
>> why would "ASD.F" be parsed as a logical pathname?
>> 
>>> Am 13.03.2026 um 21:49 schrieb Martin Simmons <[email protected]>:
>>> 
>>> Because merge-pathnames merges the directory components rather than just
>>> copying them.
>>> 
>>> The directory of "ASD.F" is (:absolute) so this overrides any directory in
>>> default-pathname.
>>> 
>>> The reason that the directory of "ASD.F" has to be (:absolute) is because that
>>> is the only way to represent a logical pathname namestring at the top level of
>>> the hierarchy.
>>> 
>>> -- 
>>> Martin Simmons
>>> LispWorks Ltd
>>> http://www.lispworks.com/
>>> 
>>> 
>>> 
>>>>>>>> On Fri, 13 Mar 2026 21:35:09 +0100, Rainer Joswig (as joswig at lisp dot de) said:
>>>> 
>>>> If it constructs a logical pathname using the host from the default-pathname, why would the directory from the default-pathname not be copied, too?
>>>> 
>>>>> Am 13.03.2026 um 19:35 schrieb Martin Simmons <[email protected]>:
>>>>> 
>>>>> 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/
>>>>>> 
>>>>> 
>>>>> _______________________________________________
>>>>> Lisp Hug - the mailing list for LispWorks users
>>>>> [email protected]
>>>>> http://www.lispworks.com/support/lisp-hug.html
>>>> 
>>>> 
>>>> _______________________________________________
>>>> Lisp Hug - the mailing list for LispWorks users
>>>> [email protected]
>>>> http://www.lispworks.com/support/lisp-hug.html
>>>> 
>>> 
>>> _______________________________________________
>>> Lisp Hug - the mailing list for LispWorks users
>>> [email protected]
>>> http://www.lispworks.com/support/lisp-hug.html
>> 
>> 
>> _______________________________________________
>> Lisp Hug - the mailing list for LispWorks users
>> [email protected]
>> http://www.lispworks.com/support/lisp-hug.html
>> 
> 
> _______________________________________________
> Lisp Hug - the mailing list for LispWorks users
> [email protected]
> http://www.lispworks.com/support/lisp-hug.html


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