This is a read-only archive of lispforum.com. The forum was locked to new users and posts and is preserved here as static HTML from a database snapshot taken on 2019-09-07.

IF + user input

4 posts · 3340 views

Can someone help me. I want to ask the user a question and then do something whether they say Yes or No.
I have tried a few ways but not really sure if i am close.
Thanks

Re: IF + user input

You mean you want to read a line of input from console like this?
  (if (string= (string-upcase (read-line *standard-input* NIL "")) "YES")
    (do-yes-stuff)
    (do-other-stuff))
There is more than one way to skin a cat. You may want to look at CL cookbook => Files
I'm the author of two useless languages that uses BF as target machine.
Currently I'm planning a Scheme compiler :p

Re: IF + user input

gugamilare wrote:There are two function which can help you:

http://www.lispworks.com/documentation/ ... y_or_n.htm
OMG I would never guessed that was within the standard library :D
Wonder how diverse it has been implemented since it's parsing is in "implementation dependent manner"
I'm the author of two useless languages that uses BF as target machine.
Currently I'm planning a Scheme compiler :p