On 11/1/11 Nov 1 -3:24 PM, Pascal Costanza wrote:
Hi,
There is a problem in the function directory-files (at least for LispWorks). Currently it is defined like this:
(defun* directory-files (directory &optional (pattern *wild-file*)) (when (wild-pathname-p directory) (error "Invalid wild in ~S" directory)) (unless (member (pathname-directory pattern) '(() (:relative)) :test 'equal) (error "Invalid file pattern ~S" pattern)) (let ((entries (ignore-errors (directory* (merge-pathnames* pattern directory))))) (filter-logical-directory-results directory entries #'(lambda (f) (make-pathname :defaults directory :version (pathname-version f) :name (pathname-name f) :type (pathname-type f))))))
However, passing (pathname-version f) unchanged makes make-pathname throw errors in most cases in LispWorks. It should rather say something like that:
(defun* directory-files (directory &optional (pattern *wild-file*)) (when (wild-pathname-p directory) (error "Invalid wild in ~S" directory)) (unless (member (pathname-directory pattern) '(() (:relative)) :test 'equal) (error "Invalid file pattern ~S" pattern)) (let ((entries (ignore-errors (directory* (merge-pathnames* pattern directory))))) (filter-logical-directory-results directory entries #'(lambda (f) (make-pathname :defaults directory :version (unless (eq (pathname-version f) :unspecific) (pathname-version f)) :name (pathname-name f) :type (pathname-type f))))))
…or something similar.
There is also a redundant 'u in the 'and form in filter-logical-directory-results.
Thanks for the bug report. Would you also pass along please an example call that shows this error in LispWorks? It would help us determine whether other implementations have similar issues.
thanks, r