I need to be able to read user input in scheme for a project, for example I need to be able to read "4 5 * ." without quotes. I was implementing it using the (read) function however it gives an error when it reads a "." . I would use a different symbol but it is specified by the project description. Is there a way to read in such an expression from the user including the "." symbol?
problem with user input in scheme
Page 1 of 11 Replies - 1547 Views - Last Post: 17 November 2012 - 11:13 PM
Replies To: problem with user input in scheme
#2
Re: problem with user input in scheme
Posted 17 November 2012 - 11:13 PM
Quoting my answer from a similar question that has been asked recently:
Quote
read reads a [Scheme] value, so the input has to be entered using [Scheme] syntax. Since you don't want that, you should use read-line which reads a line of input (without caring how it's formatted) and returns it as a string.
Page 1 of 1
|
|

New Topic/Question
Reply


MultiQuote




|