Santiago Carbonell carbonell.santiago@gmail.com writes:
Hi,
I'm trying to send some strings using the format function in LISP to a sockets but always I obtain NIL
I'm using this function:
(defun sockets_fun() (WITH-OPEN-STREAM (socket (SOCKET:SOCKET-CONNECT 49729 "localhost")) (let ((*standard-output* socket)) (format socket "The color is ~A" "red") (force-output socket) (finish-output nil) )))
But always I obtain NIL in the socket
It works well:
[pjb@kuiper :0 tmp]$ nc -t -l -p 49729 & [2] 21094 [pjb@kuiper :0 tmp]$ clisp -q -ansi -norc -x '(defun socket-fun () (WITH-OPEN-STREAM (socket (SOCKET:SOCKET-CONNECT 49729 "localhost")) (let ((*standard-output* socket)) (format socket "The color is ~A" "red") (force-output socket) (finish-output nil))))' -x '(socket-fun)' SOCKET-FUNThe color is red NIL [2]+ Done nc -t -l -p 49729 [pjb@kuiper :0 tmp]$
Why there are problems with sockets with the format function?
There's no problem with format.
But I'm wondering why you're asking a clisp question on an armedbear mailing list?