How to read lines typed & waited for. 
Author Message
 How to read lines typed & waited for.

I would like to read in the name of a person with an arbitrary number
or parts without having to be concerned about interpretation of parentheses,
and wait for the user at a terminal to type the characters in.

READ waits, but reads in only until the first space, and reads in expressions.

READ-LINE reads in the whole line but does not wait.

I am using XLISP 2.1 for WINDOWS

--
Raymond Kennington                | Act in haste and repent at leisure
                                  | Code too soon and debug forever
University of South Australia     | ....Dale and Lily (I think)
Computer and Information Science  | Knobs, knobs everywhere,
Levels                            |        just vary a knob to think!
Pooraka 5095                      | ....Metamagical Themas, Hofsta"dter
South Australia



Thu, 29 Aug 1996 13:25:05 GMT  
 How to read lines typed & waited for.

Quote:

>READ-LINE reads in the whole line but does not wait.

Of course READ-LINE waits -- it's not permitted to return until it read a
newline or EOF.

The problem you may be having is that READ-LINE is returning immediately
because it reads the newline that came after a previous READ was satisfied.
Since READ returns as soon as all parentheses match, the newline after the
terminating parenthesis will be left in the input buffer.

The solution I've used is to do a FLUSH-INPUT after the READ, to clear out
the input buffer.
--
Barry Margolin
System Manager, Thinking Machines Corp.




Sat, 31 Aug 1996 13:23:20 GMT  
 How to read lines typed & waited for.

   The solution I've used is to do a FLUSH-INPUT after the READ, to clear out
   the input buffer.

To do a what?!

 % cmucl -noinit
 CMU Common Lisp 17e, running on fnord
 Send bug reports and questions to your local CMU CL maintainer, or to

 Loaded subsystems:
     Python 1.0, target SPARCstation/Sun 4
     CLOS based on PCL version:  September 16 92 PCL (f)
 * (find-all-symbols "FLUSH-INPUT")

 NIL
 *

--

  Lehman Brothers          
  388 Greenwich Street      ``A great many people think they are thinking when
  New York, NY 10013          they are merely rearranging their prejudices.''
  (212) 464-4750                                        - William James



Sun, 01 Sep 1996 03:40:13 GMT  
 How to read lines typed & waited for.

   The solution I've used is to do a FLUSH-INPUT after the READ, to clear out
   the input buffer.

I mistakenly sent my last response too soon.  I meant to include a
note that CLEAR-INPUT is the right thing to do . . . .

--

  Lehman Brothers          
  388 Greenwich Street      ``A great many people think they are thinking when
  New York, NY 10013          they are merely rearranging their prejudices.''
  (212) 464-4750                                        - William James



Sun, 01 Sep 1996 03:53:22 GMT  
 How to read lines typed & waited for.

Quote:

>The solution I've used is to do a FLUSH-INPUT after the READ, to clear out
>the input buffer.

Oops, that should be CLEAR-INPUT.
--
Barry Margolin
System Manager, Thinking Machines Corp.




Sun, 01 Sep 1996 05:01:54 GMT  
 How to read lines typed & waited for.

Quote:


>   The solution I've used is to do a FLUSH-INPUT after the READ, to clear out
>   the input buffer.

>To do a what?!
> ..[etc.]

I'm surprised that Barry gave a non-common lisp answer. He's usually
precise and on the money with his responses. :-)

Anyway, I saw the original posting and wondered what the question
really was.  It's time to end this thread...

To original poster:  What exactly is the problem/question?  What
behavior are you after?  Send me E-mail and I'll answer.

Pete.



Fri, 06 Sep 1996 08:48:44 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. reading a line and executing a command on that line

2. how to read text files line by line?

3. reading file line by line

4. new question in how can i read data from file line by line

5. reading line by line

6. Reading line-by-line on a socket

7. line-by-line file read

8. Help: how to read line by line...

9. Read a text file line by line

10. Reading Arguments from Command Line and reading binary data

11. read-char read-line

12. Queueing/Waiting Line Theory?

 

 
Powered by phpBB® Forum Software