Siegfried Gonzi <email@example.com> 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: ")
> (let ((x (prompt-for-number-and-read)))
(format t "The number you typed was '~D'~%" x)
Type a number: 37
The number you typed was '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 Warnock, 30-3-510 <firstname.lastname@example.org>
SGI Network Engineering <http://www.rpw3.org/>
1600 Amphitheatre Pkwy. Phone: 650-933-1673
Mountain View, CA 94043 PP-ASEL-IA
[Note: email@example.com and firstname.lastname@example.org aren't for humans ]