merge-pathnames bug with :back component
CLHS for merge-pathnames specifies that, "This removal of redundant :back keywords is repeated as many times as possible." abcl-1.3.2 The first expression below evaluates correctly, but the second produces an error. FCFS(34): (merge-pathnames (make-pathname :directory '(:relative "a" "b" :back)) (make-pathname :directory '(:absolute "root"))) #P"/root/a/" FCFS(35): (merge-pathnames (make-pathname :directory '(:relative "a" "b" :back :back)) (make-pathname :directory '(:absolute "root"))) #<THREAD "interpreter" {43B4AF3C}>: Debugger invoked on condition of type FILE-ERROR Unsupported directory component BACK. Restarts: 0: TOP-LEVEL Return to top level. For what it's worth, CCL also produces an error. CLISP, ECL, SBCL correctly produce: #P"/root/" (That said, I'm far from a pathname expert and could be completely wrong.) Vibhu
I was going to add this as an error report for CCL, but I see you've already done that. Thanks! Blake On Mon, Jun 13, 2016 at 10:00 PM, Vibhu Mohindra <vibhu.mohindra@gmail.com> wrote:
CLHS for merge-pathnames specifies that, "This removal of redundant :back keywords is repeated as many times as possible."
abcl-1.3.2 The first expression below evaluates correctly, but the second produces an error.
FCFS(34): (merge-pathnames (make-pathname :directory '(:relative "a" "b" :back)) (make-pathname :directory '(:absolute "root")))
#P"/root/a/" FCFS(35): (merge-pathnames (make-pathname :directory '(:relative "a" "b" :back :back)) (make-pathname :directory '(:absolute "root")))
#<THREAD "interpreter" {43B4AF3C}>: Debugger invoked on condition of type FILE-ERROR Unsupported directory component BACK. Restarts: 0: TOP-LEVEL Return to top level.
For what it's worth, CCL also produces an error. CLISP, ECL, SBCL correctly produce: #P"/root/"
(That said, I'm far from a pathname expert and could be completely wrong.)
Vibhu
participants (2)
-
Blake McBride
-
Vibhu Mohindra