Subject: merge-pathnames bug?

From: Dorai Sitaram <[email-masked]>
Date: Fri, 12 Feb 1999 22:41:46 -0500 (EST)

I believe there is a bug in merge-pathnames.  (I'm
using with January 1999 CLISP on Red Hat Linux 5.2.)

(setq x (pathname "../j.lsp"))
(setq xdir (make-pathname :directory (pathname-directory x)))

(setq y (pathname "a/b/c.lsp"))

(merge-pathnames y xdir)

returns

#P"a/b/c.lsp"

when I would have expected 

#P"../a/b/c.lsp"

I tried the same in Allegro CL 5.0, which gives the
expected answer.

(This is not as puzzling an example as it might appear
prima facie.  Within CL files, I'd like to load other
CL files using relative pathnames, where the relativity
is wrt to the loading file (like in HTML files, say),
not the directory where CL was invoked.  The above
corresponds to my loading ../j.lsp where this file
loads a/b/c.lsp relative to itself, i.e., ../a/b/c.lsp
relative to me.)

--d

---

From: Fred Cohen <[email-masked]>
Date: Sat, 13 Feb 1999 06:42:07 -0800 (PST)

> (setq xdir (make-pathname :directory (pathname-directory x)))

In general, pathnames and filenames and directory names in Clisp seem to
do things poorly. Has anybody written a routine to ease off on the syntactic
requirements, figure out what's a directory, file, etc. and handle it all
in a reasonable way?

FC