directory: Behaviour for non-wild paths as intended?
The CLHS entry on directory
has this (non-binding) note:
If the pathspec is not wild, the resulting list will contain either zero or one elements.
(It doesn't say when the list should be empty and when it should be a singleton). This output:
(directory "/home/pipping/sbcl-test/")
=> (#P"/home/pipping/sbcl-test/.dir/" #P"/home/pipping/sbcl-test/dir/"
#P"/home/pipping/sbcl-test/file" #P"/home/pipping/sbcl-test/dir/"
#P"/home/pipping/sbcl-test/dir/dir-in-dir/" #P"/home/pipping/sbcl-test/file")
clearly goes against the note, though. CMU CL is not the only lisp to ignore it (others are Allegro CL and LispWorks). But there are plenty of lisps that appear to respect it. Since it's just a note, "we decided to ignore it on purpose" is an acceptable answer; I wanted to raise this issue and make sure that's indeed intended, though.
NB: This is not an issue of pathnames vs. strings:
(wild-pathname-p (pathname "/home/pipping/sbcl-test/"))
=> NIL
(directory (pathname "/home/pipping/sbcl-test/"))
=> (#P"/home/pipping/sbcl-test/.dir/" #P"/home/pipping/sbcl-test/dir/"
#P"/home/pipping/sbcl-test/file" #P"/home/pipping/sbcl-test/dir/"
#P"/home/pipping/sbcl-test/dir/dir-in-dir/" #P"/home/pipping/sbcl-test/file")