I can't find in CLHS where the following namestring call would be
allowed to raise an error:
* (caar (logical-pathname-translations "NORVIG"))
#<LOGICAL-PATHNAME (with no namestring)
:HOST #<SB-KERNEL:LOGICAL-HOST "NORVIG">
:DEVICE :UNSPECIFIC
:DIRECTORY (:ABSOLUTE :WILD-INFERIORS)
:NAME :WILD
:TYPE NIL
:VERSION NIL>
* (type-of (caar (logical-pathname-translations "NORVIG")))
LOGICAL-PATHNAME
* (namestring (caar (logical-pathname-translations "NORVIG")))
debugger invoked on a TYPE-ERROR: The value :WILD is not of type SEQUENCE.
Type HELP for debugger help, or (SB-EXT:QUIT) to exit from SBCL.
restarts (invokable by number or by possibly-abbreviated name):
0: [ABORT] Exit debugger, returning to top level.
(SB-IMPL::UNPARSE-LOGICAL-FILE
#<LOGICAL-PATHNAME (with no namestring)
:HOST #<SB-KERNEL:LOGICAL-HOST "NORVIG">
:DEVICE :UNSPECIFIC
:DIRECTORY (:ABSOLUTE :WILD-INFERIORS)
:NAME :WILD
:TYPE NIL
:VERSION NIL>)
0]
Compare with clisp:
[18]> (caar (logical-pathname-translations "NORVIG"))
#P"NORVIG:**;*.*"
[19]> (type-of (caar (logical-pathname-translations "NORVIG")))
LOGICAL-PATHNAME
[20]> (namestring (caar (logical-pathname-translations "NORVIG")))
"NORVIG:**;*.*"
[21]>
And note that sbcl still can do it in where the type is not NIL;
* (car (second (logical-pathname-translations "NORVIG")))
#P"NORVIG:**;*.*"
* (type-of (car (second (logical-pathname-translations "NORVIG"))))
LOGICAL-PATHNAME
* (namestring (car (second (logical-pathname-translations "NORVIG"))))
"NORVIG:**;*.*"
* (defun print-pathname (p)
(format t "~&~{~{~@(~9A~) : ~S~&~}~}"
(mapcar (lambda (name field) (list name (funcall field p)))
'(host device directory name type version)
'(pathname-host pathname-device pathname-directory
pathname-name pathname-type pathname-version))))
PRINT-PATHNAME
* (print-pathname (car (second (logical-pathname-translations "NORVIG"))))
Host : #<SB-KERNEL:LOGICAL-HOST "NORVIG">
Device : :UNSPECIFIC
Directory : (:ABSOLUTE :WILD-INFERIORS)
Name : :WILD
Type : :WILD
Version : NIL
NIL
* (print-pathname (car (first (logical-pathname-translations "NORVIG"))))
Host : #<SB-KERNEL:LOGICAL-HOST "NORVIG">
Device : :UNSPECIFIC
Directory : (:ABSOLUTE :WILD-INFERIORS)
Name : :WILD
Type : NIL
Version : NIL
NIL
* (PRINT-BUG-REPORT-INFO)
LISP-IMPLEMENTATION-TYPE "SBCL"
LISP-IMPLEMENTATION-VERSION "0.9.12"
SOFTWARE-TYPE "Linux"
SOFTWARE-VERSION "2.6.15-c3"
MACHINE-INSTANCE "thalassa"
MACHINE-TYPE "X86"
MACHINE-VERSION "AMD Athlon(tm) Processor"
*FEATURES* (:ASDF :ANSI-CL
:COMMON-LISP
:SBCL
:UNIX
:SB-DOC
:SB-TEST
:SB-PACKAGE-LOCKS
:SB-UNICODE
:SB-SOURCE-LOCATIONS
:IEEE-FLOATING-POINT
:X86
:ELF
:LINUX
:GENCGC
:STACK-GROWS-DOWNWARD-NOT-UPWARD
:C-STACK-IS-CONTROL-STACK
:STACK-ALLOCATABLE-CLOSURES
:ALIEN-CALLBACKS
:LINKAGE-TABLE
:OS-PROVIDES-DLOPEN
:OS-PROVIDES-DLADDR
:OS-PROVIDES-PUTWC)
*
------------------------------
namestring pathname => namestring
These functions convert pathname into a namestring. The name represented by
pathname is returned as a namestring in an implementation-dependent canonical
form.
------------------------------
pathname designator n. a designator for a pathname; that is, an object
that denotes a pathname and that is one of: a pathname namestring
(denoting the corresponding pathname), a stream associated with a file
(denoting the pathname used to open the file; this may be, but is not
required to be, the actual name of the file), or a pathname (denoting
itself). See Section 21.1.1.1.2 (Open and Closed Streams).
pathname n. an object of type pathname, which is a structured
representation of the name of a file. A pathname has six components: a
``host,'' a ``device,'' a ``directory,'' a ``name,'' a ``type,'' and a
``version.''
namestring n. a string that represents a filename using either the
standardized notation for naming logical pathnames described in
Section 19.3.1 (Syntax of Logical Pathname Namestrings), or some
implementation-defined notation for naming a physical pathname.
------------------------------
System Class PATHNAME
Class Precedence List:
pathname, t
Description:
A pathname is a structured object which represents a filename.
There are two kinds of pathnames---physical pathnames and logical pathnames.
------------------------------
--
__Pascal Bourguignon__ http://www.informatimago.com/
IMPORTANT NOTICE TO PURCHASERS: The entire physical universe,
including this product, may one day collapse back into an
infinitesimally small space. Should another universe subsequently
re-emerge, the existence of this product in that universe cannot be
guaranteed.
|