X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcode%2Fquery.lisp;h=4dc5d6ac92ebbdd60a59215f5a17146aa6038f0a;hb=d771d9b799b609e7b75b799d2879b4fda1ba8fa7;hp=03121376bc7d38877c926ece2ad0f8ac796b12a4;hpb=771b864c8f32af7734bc0550aeaf1539fc4df194;p=sbcl.git diff --git a/src/code/query.lisp b/src/code/query.lisp index 0312137..4dc5d6a 100644 --- a/src/code/query.lisp +++ b/src/code/query.lisp @@ -30,7 +30,7 @@ (defun clarify-legal-query-input (yes no) (format *query-io* "~&Please type \"~A\" for yes or \"~A\" for no.~%" - yes no)) + yes no)) (defun y-or-n-p (&optional format-string &rest arguments) #!+sb-doc @@ -39,24 +39,24 @@ n or N as a negative answer. It asks again if you enter any other characters." (flet ((print-query () - (apply #'maybe-print-query "(y or n)" format-string arguments))) + (apply #'maybe-print-query "(y or n)" format-string arguments))) (loop (print-query) - (case (query-read-char) - ((#\y #\Y) (return t)) - ((#\n #\N) (return nil)) - (t (clarify-legal-query-input "y" "n")))))) - + (case (query-read-char) + ((#\y #\Y) (return t)) + ((#\n #\N) (return nil)) + (t (clarify-legal-query-input "y" "n")))))) + (defun yes-or-no-p (&optional format-string &rest arguments) #!+sb-doc "YES-OR-NO-P is similar to Y-OR-N-P, except that it clears the input buffer, beeps, and uses READ-LINE to get the strings YES or NO." (flet ((print-query () - (apply #'maybe-print-query "(yes or no)" format-string arguments))) + (apply #'maybe-print-query "(yes or no)" format-string arguments))) (beep *query-io*) (loop (print-query) - (let ((input (query-read-line))) - (cond - ((string-equal input "yes") (return t)) - ((string-equal input "no") (return nil)) - (t (clarify-legal-query-input "yes" "no"))))))) + (let ((input (query-read-line))) + (cond + ((string-equal input "yes") (return t)) + ((string-equal input "no") (return nil)) + (t (clarify-legal-query-input "yes" "no")))))))