1 Replies - 2738 Views - Last Post: 17 November 2012 - 11:13 PM

#1 darthdudey  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 7
  • Joined: 28-January 12

problem with user input in scheme

Posted 17 November 2012 - 06:53 PM

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?
Is This A Good Question/Topic? 0
  • +

Replies To: problem with user input in scheme

#2 sepp2k  Icon User is online

  • D.I.C Lover
  • member icon

Reputation: 2013
  • View blog
  • Posts: 3,038
  • Joined: 21-June 11

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.

Was This Post Helpful? 2
  • +
  • -

Page 1 of 1