0

I'm trying to make a prompt for user input, but each time i call this function, instead of printing the ":", it waits until I press something and after that prints the character ":".

I can't find anything on the web.

(defun MovimientoAdversario ()
  (let ((aux))
    (format t "~% :")
    (setf aux (read))))
2
  • possible duplicate of slime prints my (format ...) calls only when called function ends Commented Oct 28, 2013 at 18:14
  • This doesn't actually have much to do with read, except that it happens to be the next input/output operation. You just need to flush the output buffer (which the possible duplicate) describes how to do. Commented Oct 28, 2013 at 18:15

1 Answer 1

2

Try flushing the output buffers before reading:

(format t "~% :")
(force-output)
(setf aux (read))
Sign up to request clarification or add additional context in comments.

1 Comment

Thank you very much! You save my sorry a.. . Thank you! Thank you!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.