Problems with read function in lisp

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))))

Upvotes: 0

Views: 134

Answers (1)

Frédéric Hamidi
Frédéric Hamidi

Reputation: 262939

Try flushing the output buffers before reading:

(format t "~% :")
(force-output)
(setf aux (read))

Upvotes: 2

Related Questions