Ticket #970 (closed defect: invalid)
DIRECTORY includes directories by default
|Reported by:||adapterik||Owned by:|
|Component:||ANSI CL Compliance||Version:||trunk|
I think that DIRECTORY is out of compliance with the (albeit fuzzy in this regard) ANSI CL as well as the CCL documentation for said function.
According to the ANSI CL, DIRECTORY should return "files", and by "files" it is pretty clear it does not refer to directories. The spec gives plenty of wiggle room for extensions, however.
CCL provides the extension keyword options :DIRECTORIES and :FILES to specify whether directories and/or files are considered. :DIRECTORIES should default to nil according to the CCL docs (and my interpretation of ANSI CL compliance) but actually defaults to T (from usage results and source code inspection.) Thus the bare, naked usage of DIRECTORY, such as (DIRECTORY "*") will provide directories, if any are found, in the results.
If CCL's DIRECTORY defaults to :DIRECTORY nil, it would be in compliance as far as this point goes. However, I think there is further work to ensure that DIRECTORY (and related functions like PROBE-FILE) are consistent and compliant in the treatment of pathnames.
That will be the subject of a follow up either here or the the mailing list.
Man do I feel like a nit picking Lisper now!