Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!think.com!barmar From: barmar@think.com (Barry Margolin) Newsgroups: comp.lang.lisp Subject: Re: weird common lisp feature Keywords: read, read-line Message-ID: <1991Feb21.104336.26012@Think.COM> Date: 21 Feb 91 10:43:36 GMT References: <12413@helios.TAMU.EDU> Sender: news@Think.COM Organization: Thinking Machines Corporation, Cambridge MA, USA Lines: 17 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)) My guess is that KCL's READ performs a FORCE-OUTPUT call before starting to read input, but READ-LINE doesn't. I don't think CLtL specifies anything about this interaction, so I suggest you put your own call to FORCE-OUTPUT before any input functions when necessary. -- Barry Margolin, Thinking Machines Corp. barmar@think.com {uunet,harvard}!think!barmar