Subject: Re: Scheme Compilers???
From: rpw3@rigden.engr.sgi.com (Rob Warnock)
Date: 25 Jul 2002 07:14:23 GMT
Newsgroups: comp.lang.scheme
Message-ID: <aho8gf$bbul6$1@fido.engr.sgi.com>
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 ]