On 16 March 2010 11:41, james anderson james.anderson@setf.de wrote:
This is invalid as a pathname to an actual file, only valid as something that you can merge with a pathname that has a type: (make-pathname :directory directory :name "typed-file.type" :type nil)
"this" is a file without a type?
I haven't really been following, but I hope I'm sufficiently on track to understand the confusion.
One of the core problems (or features, if you like) in CLHS pathname specification is the requirement for
Pathname <-> Namestring
translations to be information preserving.
From this is follows (at least by IMO reasonable attempts to treat
pathnames with any consistency) that EITHER there are pathnames for which no namestring exists OR that namestring syntax no longer even remotely resembles the native namestring syntax of the platform -- which is generally speaking a lossy idea since the standard does not provide a NATIVE-NAMESTRING function.
So, we can reasonably say
(make-pathname :name "foo" :type nil) <-> "foo"
and
(make-pathname :name "foo" :type "bar") <-> "foo.bar"
but even an apparently innocent things like
(make-pathname :name "foo.tar" :type "gz") (make-pathname :name "foo" :type "tar.gz")
are wrought with difficulty.
For Common Lisp these are two non-equal pathnames, so the namestrings --if they exist-- should be non-equal.
SBCL takes the stance that the first one has the namestring "foo.tar.gz", and that the second one has no namestring -- another implementation could take the opposite stance, though I freely submit that IMO disallowing dots in types is less problematic than disallowing them in names.
The issue with (make-pathname :name "foo.bar" :type nil) is identical.
Cheers,
-- Nikodemus