Path: utzoo!mnetor!uunet!mcvax!ukc!its63b!aiva!jeff From: jeff@aiva.ed.ac.uk (Jeff Dalton) Newsgroups: comp.lang.lisp Subject: Re: Is LISPcraft mistaken? Message-ID: <250@aiva.ed.ac.uk> Date: 6 Feb 88 18:30:25 GMT References: <11022@shemp.UCLA.EDU> Reply-To: jeff@uk.ac.ed.aiva (Jeff Dalton) Organization: Dept. of AI, Univ. of Edinburgh, UK Lines: 52 In article <11022@shemp.UCLA.EDU> krowney@MATH.UCLA.EDU (Kevin Rowney) writes: ] ] I am having problems with the inter-process communication facilities ] running on Franz Lisp. ] -> ;Fire up and get ports to a "wc" process. ] (setq ports (*process 'wc t t)) ] (%from-process %to-process 6550) ] ] -> ;Feed the running "wc" some input ] (mapc '(lambda (x) (print x (cadr ports))) '(a b c d)) ] (a b c d) ] ] -> ;Read any results that might have come back ] (read (car ports)) ] Perhaps for some reason this worked for Wilensky, but it doesn't for me, and I can see why not. Suppose you type 'wc' to a shell and then type 'abcd' to it. What is the response? When I do it, there isn't one. Type a newline. Still no response. Finally type an end of file. Only then does wc produce any output. So, trying the same thing (modulo the eof effect) in Lisp: Franz Lisp, Opus 38.91 [Loading .lisprc] -> (setq ports (*process 'wc t t)) (%from-process %to-process 1091) -> (print 'abc (cadr ports)) nil -> (close (cadr ports)) ;really end input. t -> (read (car ports)) 0 -> (read (car ports)) 1 -> (read (car ports)) 3 -> (close (car ports)) t -> (wait) (1091 . 0) -> WC therefore turns out to be a losing example. Try something interactive (like another Lisp), and the results will be more interesting. (Don't forget to send newlines with terpri.) Jeff Dalton, JANET: J.Dalton@uk.ac.ed AI Applications Institute, ARPA: J.Dalton%uk.ac.ed@nss.cs.ucl.ac.uk Edinburgh University. UUCP: ...!ukc!ed.ac.uk!J.Dalton