まぁ、 Lisp は「ディレクトリ」って概念がないフィアルシステム上でも動いてきたからね…。 ファイルやディレクトリを扱うには Edi Weitz 氏の CL-FAD (File And Directory) が今は標準的。 元は Peter Seibel が Practical Common Lisp 書くときに用意したやつで、Edi 氏がパッケージにして公開してくれる。 で、件の処理はパッケージ内で以下のように定義されてる。pathname-name と pathname-type が無いものがディレクトリであると。 これで不自由はしてないよ。
(defun component-present-p (value) "Helper function for DIRECTORY-PATHNAME-P which checks whether VALUE is neither NIL nor the keyword :UNSPECIFIC." (and value (not (eql value :unspecific))))
(defun directory-pathname-p (pathspec) "Returns NIL if PATHSPEC \(a pathname designator) does not designate a directory, PATHSPEC otherwise. It is irrelevant whether file or directory designated by PATHSPEC does actually exist." (and (not (component-present-p (pathname-name pathspec))) (not (component-present-p (pathname-type pathspec))) pathspec))