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)
Path: e27ni4182bkw.0!nntp.google.com!news2.google.com!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail
From: d...@scieneer.com
Newsgroups: comp.lang.lisp
Subject: Re: Pathname host when merging relative pathnames
Date: Tue, 15 May 2012 00:37:37 -0700 (PDT)
Organization: http://groups.google.com
Lines: 47
Message-ID: <1323654.278.1337067457333.JavaMail.geo-discussion-forums@pbcw8>
References: <960342.3.1336837461919.JavaMail.geo-discussion-forums@pbcmf4>
<m3fwb2xhwz.fsf@leonis4.robolove.meer.net> <josudk$h3j$1@dont-email.me>
NNTP-Posting-Host: 202.164.205.22
Mime-Version: 1.0
X-Trace: posting.google.com 1337072176 18838 127.0.0.1 (15 May 2012 08:56:16 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Tue, 15 May 2012 08:56:16 +0000 (UTC)
In-Reply-To: <josudk$h3j$1@dont-email.me>
Complaints-To: groups-abuse@google.com
Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=202.164.205.22;
posting-account=9e7kBQoAAABIAqA_qvIvmGkI_QYWlNyD
User-Agent: G2/1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
On Tuesday, May 15, 2012 4:51:30 PM UTC+10, Raymond Toy wrote:
> On 5/14/12 8:05 PM, Madhu wrote:
> >=20
> > * Douglas <960342.3.1336837461919.JavaMail.geo-discussion-forums@pbcmf4=
> :
> > Wrote on Sat, 12 May 2012 08:44:21 -0700 (PDT):
> >=20
> > | One workaround is to allow 'make-pathname to accept a host of 'nil an=
d
> > | 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"
> >=20
> > I would recommend this approach - legalizing NIL as a PATHNAME-HOST, an=
d
> > specifying these semantics. I think I tried [unsuccessfully] to defend
> > this on cmu-imp towards the end of 2004.
>=20
> 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
> expected.)
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=
?=20
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.