Bruno Haible wrote:
> Sam writes:
> > >> > your way is:
> > >> > (make-pathname :defaults path something)
> > >> > ==
> > >> > (merge-pathnames (make-pathname something) path)
> > >>
> > >> Yes, that's how I interpreted the standard from the beginning.
Allegro, CMUCL, CormanLisp & Lispworks all interpret the standard my
I guess this means that my interpretation is a "de-facto standard". :-)
[I have a hunch that this argument will work against me :-]
> > but this is unreasonable: why provide both make-pathname/:defaults and
> > merge-pathnames/make-pathname which have the same functionality?
> It's not the same functionality: make-pathname takes a few pieces and
> a default pathname; merge-pathnames takes an entire pathname and a
> default pathname.
the functionality is essentially the same though.
If I have a path and some other components, then CLISP has two ways to
identical results, while, IMO, the standard calls for two ways to
different useful results.
> Besides that, a standard or library is more consistent if documented
> functions (like merge-pathnames) are really used internally and not
> simulated by a 99% work-alike (like the like-merge-pathnames-but-keep-
> explicitly-specified-nils-intact one you are proposing).
yes, you would have been right if I were talking about a different
of defaults, but I am talking only about **ORDER OF APPLICATION**:
you first make a pathname out of other args, then use merge-path, I
first from defaults and then applying other explicit arguments.
> > It is much more reasonable for these two functions to provide different
> > functionalities, so that the user can do more!
> No, it's more reasonable if their merging part is the same.
the question is order: you think that make-pathname/:defauls has the
of execution as merge+make, but this, IMO, is wrong. Why should they?
Basically, you enforce ignoring some of the explicit arguments, which is
> > >> > anyway, how do I extract the non-file part of a path?
> > >>
> > >> (make-pathname :host (pathname-host old)
> > >> :device (pathname-device old)
> > >> :directory (pathname-directory old))
> > Come on, Bruno, this is ugly as hell!
> It's the way pathname hacking is done in CL for 10 years. See function
> new-file-type in clocc/src/defsystem-3.x/defsystem.lisp for example.
so, why should we perpetuate this ugliness?