Siegfried Gonzi <siegfried.gonzi@kfunigraz.ac.at> wrote:
+---------------
| In CommonLisp I never grasped how to pass values in the console
| (the program should ask me to type in a number for example);
| this is or was utterly complicated...
+---------------
Hunh? What's so complicated about it?
> (defun prompt-for-number-and-read ()
(format *query-io* "~%Type a number: ")
(read *query-io*))
PROMPT-FOR-NUMBER-AND-READ
> (let ((x (prompt-for-number-and-read)))
(format t "The number you typed was '~D'~%" x)
x)
Type a number: 37
The number you typed was '37'
37
>
From CLHS "21.1.2 Stream Variables", thence "*query-io*":
The value of *QUERY-IO*, called "query I/O", is a bidirectional
stream to be used when asking questions of the user. The question
should be output to this stream, and the answer read from it.
-Rob
-----
Rob Warnock, 30-3-510 <rpw3@sgi.com>
SGI Network Engineering <http://www.rpw3.org/>
1600 Amphitheatre Pkwy. Phone: 650-933-1673
Mountain View, CA 94043 PP-ASEL-IA
[Note: aaanalyst@sgi.com and zedwatch@sgi.com aren't for humans ]