Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!wuarchive!udel!princeton!phoenix!eliot From: eliot@phoenix.Princeton.EDU (Eliot Handelman) Newsgroups: comp.lang.lisp Subject: Re: weird common lisp feature Keywords: read, read-line Message-ID: <6466@idunno.Princeton.EDU> Date: 21 Feb 91 09:32:08 GMT References: <12413@helios.TAMU.EDU> Sender: news@idunno.Princeton.EDU Organization: Cognitive Science Lab, Princeton University Lines: 26 In article <12413@helios.TAMU.EDU> e343ca@tamuts.tamu.edu (Colin Allen) writes: ;Can anyone tell me why foo1 below appears to execute the read-line ;before the print, but foo2 executes the print before the read? ; ;(defun foo1 () (print 'hello) (read-line)) ;(defun foo2 () (print 'hello) (read)) In my KCL READ-LINE reads the hanging #\Newline when you hit return. If I were to execute foo1 I'd get something like this: > (foo1) HELLO"" I don't have a chance to type in anything at all. If I do this: > (progn (foo1) (foo1))) HELLO HELLOand now I can type "and now I can type" Note, incidentally, another KCl bug -- PRINT doesn't leave a space after printing, as it should. Anyhow, READ-LINE doesn't work right in KCL, and the thought occurs to me -- is it possible that READ-LINE is reading the PRINT statement?