Bugs in merging with *default-pathname-defaults*

Raymond Toy <[email protected]>
Newsgroups gmane.lisp.cmucl.devel
Message-ID <[email protected]>
Zach Beane has pointed out to me that cmucl doesn't merge the pathname
with *default-pathname-defaults* as required in CLHS 19.2.3.

In particular, OPEN, ENSURE-DIRECTORIES-EXIST, FILE-AUTHOR, and
DELETE-FILE don't merge.  This is now fixed in cvs.

I'm too lazy to make a patch for 20a for this (if you really want one,
speak up!) so I offer the following fix for this issue.

(/fwrappers:define-fwrapper/ force-merge-pathname (filename &rest options)
  (setf <http://www.lispworks.com/reference/HyperSpec/Body/a_setf.htm> filename (merge-pathnames <http://www.lispworks.com/reference/HyperSpec/Body/f_merge_.htm> filename))
  (fwrappers::call-next-function))

(fwrappers:fwrap 'open <http://www.lispworks.com/reference/HyperSpec/Body/f_open.htm> #'force-merge-pathname)
(fwrappers:fwrap 'ensure-directories-exist <http://www.lispworks.com/reference/HyperSpec/Body/f_ensu_1.htm> #'force-merge-pathname)
(fwrappers:fwrap 'file-author #'force-merge-pathname)
(fwrappers:fwrap 'delete-file #'force-merge-pathname)

(This is pretty neat.  I've never used fwrappers before, even though they've been there for years now.)

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