[slime-devel] pathname on a socket stream
Marco Baringer
mb at bese.it
Sun Apr 23 12:16:35 UTC 2006
this came up when trying to use slime's inspector to inspect a socket
connected to a remote server. the following snippet signals an error:
CL-USER> (let* ((socket (make-instance 'sb-bsd-sockets:inet-socket
:type :stream
:protocol :tcp)))
(sb-bsd-sockets:socket-connect socket #(127 0 0 1) 8080)
(sb-bsd-sockets:socket-make-stream socket))
#<SB-SYS:FD-STREAM for "a constant string" {40D28759}>
CL-USER> (pathname *)
Error:
The value NIL is not of type PATHNAME.
[Condition of type TYPE-ERROR]
however, substitiuting the call to pathname for its definiton return
NIL:
CL-USER> (let* ((socket (make-instance 'sb-bsd-sockets:inet-socket
:type :stream
:protocol :tcp)))
(sb-bsd-sockets:socket-connect socket #(127 0 0 1) 8080)
(sb-impl::with-pathname (pathname (sb-bsd-sockets:socket-make-stream socket))
pathname))
NIL
CL-USER>
i'm not really sure what the correct answer is, according to the
hyperspec pathname must return a pathname object and NIL is definetly
not a pathname object. at the same time a file stream is a pathname
designator and pathname is defined to accept pathname designator (the
hyperspec doesn't mention any exceptional situations). is there some
(non neccessarily portable) means to determine if a stream is a valid
value for passing to pathname?
--
-Marco
Ring the bells that still can ring.
Forget the perfect offering.
There is a crack in everything.
That's how the light gets in.
-Leonard Cohen
More information about the slime-devel
mailing list