| READWORD | |
| Syntax | READWORD (READWORD channel) |
| Explanation | READWORD reports the first object from the input stream. If no object is waiting to be read and the input stream is the Listener, READWORD waits for input from the keyboard. If the input consists of more than one word, the remainder of the input is ignored.
READWORD reports the empty list if <Enter> is pressed as input. Compare with READ, which does not accept the empty list as input, but waits for a response that is not empty. A channel number may be entered as an optional input. If present, READWORD reads from that channel instead of reading from the input stream. This makes it easier to switch among multiple input streams. See also READCHAR, READLINE, READLIST, READPROMPT, and READQUOTE.
|
| Examples | TO GREETING PR [WHAT'S YOUR NAME?] MAKE "RESPONSE READWORD PR SENTENCE [HI THERE,] WORD :RESPONSE "! END GREETING defined GREETING WHAT'S YOUR NAME? (just <Enter> is pressed) HI THERE, ! GREETING WHAT'S YOUR NAME? ELEANOR HI THERE, ELEANOR! GREETING WHAT'S YOUR NAME? ELEANOR RIGBY HI THERE, ELEANOR! |