2009/12/10 Tobias C. Rittweiler <tcr@...>:
> (defun foo (dirent)
> (char= #\. (char (sb-posix:dirent-name dirent) 0)))
> results in the following
> ; caught WARNING:
> ; The binding of ARRAY is not a STRING:
> ; NIL
> ; See also:
> ; The SBCL Manual, Node "Handling of Types"
DESCRIBE knows why:
Derived type: (FUNCTION
(SB-POSIX::PADDING-8-0 (ARRAY (SIGNED 8) 8))
(SB-POSIX::NAME (ARRAY (SIGNED 8) 256))
(SB-POSIX::PADDING-0-264 (ARRAY (SIGNED 8) 0))))))
(OR (SIMPLE-ARRAY CHARACTER (*))
(SIMPLE-ARRAY NIL (*)) SIMPLE-BASE-STRING
(ALIEN (* (SIGNED 8)))
(SIMPLE-ARRAY (UNSIGNED-BYTE 8)) NULL)
So the compiler is telling you that you might not be getting a string
back. In all likelihood the compiler is able to boil it down to (OR
STRING NULL), hence the complaint about NIL not being a string.
That said, I have no immediate clue why the return type includes
(ALIGN (* (SIGNED 8)) and (SIMPLE-ARRAY (UNSIGNED-BYTE 8)) above.