Message from discussion Pathname host when merging relative pathnames
Received: by 10.204.156.199 with SMTP id y7mr1313978bkw.7.1337072176223;
Tue, 15 May 2012 01:56:16 -0700 (PDT)
Subject: Re: Pathname host when merging relative pathnames
Date: Tue, 15 May 2012 00:37:37 -0700 (PDT)
X-Trace: posting.google.com 1337072176 18838 127.0.0.1 (15 May 2012 08:56:16 GMT)
NNTP-Posting-Date: Tue, 15 May 2012 08:56:16 +0000 (UTC)
Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=18.104.22.168;
Content-Type: text/plain; charset=ISO-8859-1
On Tuesday, May 15, 2012 4:51:30 PM UTC+10, Raymond Toy wrote:
> On 5/14/12 8:05 PM, Madhu wrote:
> > * Douglas <960342.3.1336837461919.JavaMail.geo-discussion-forums@pbcmf4=
> > Wrote on Sat, 12 May 2012 08:44:21 -0700 (PDT):
> > | One workaround is to allow 'make-pathname to accept a host of 'nil an=
> > | to not default this if supplied, so that a relative pathname could be
> > | created for which the standard merging rules would copy the host.
> > | However without the host the pathname may become unprintable, or at
> > | least fall back to a native format.
> > |
> > | For example:
> > | (merge-pathnames (make-pathname :host nil :defaults "TEST:;FILE.LISP"=
> > | "/home/") =3D> #P"/home/file.lisp"
> > | (merge-pathnames (make-pathname :host nil :defaults "file.lisp")
> > | "TEST:PATH;") =3D> #P"TEST:PATH;FILE.LISP"
> > I would recommend this approach - legalizing NIL as a PATHNAME-HOST, an=
> > specifying these semantics. I think I tried [unsuccessfully] to defend
> > this on cmu-imp towards the end of 2004.
> I'm too lazy to look up when it happened and I don't remember right now
> why :host nil was added, but this is how cmucl merges pathnames with a
> host of nil. Well, except the first result is #p"/home/FILE.LISP". (I
> guess an appropriate choice of :case would make the case come out as
The CMUCL stores the customary case in the host object so without a host pe=
rhaps the case problems are inevitable. How do you diddle the case when ma=
king a pathname with a 'nil host given defaults that are a logical-pathname=
Perhaps this illustrates another problem with the 'nil host solution - with=
out the host the namestring is undefined. Note Kents solution appears to k=
eep the host but adds a flag to control merging of the host and if CMUCL us=
ed a similar solution then it would still have the host object to consult f=
or the customary case - I don't advocate this solution just yet as a change=
to the merging rules seems simpler.